Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / kernel / arch / x86_64 / arch.c
blob87831b257d14c80e2da8d37c8a26dc05e9d167e7
1 /*
2 * ZeX/OS
3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 unsigned int_enable ()
21 __asm__ __volatile__("sti"
26 return 1;
29 unsigned int_disable ()
31 __asm__ __volatile__("cli");
33 return 1;
36 static void draw_arch ()
38 unsigned char *textmemptr = (unsigned char *) 0xB8000;
40 textmemptr += 8*160;
42 textmemptr[0] = 'x';
43 textmemptr[1] = 0x0f;
44 textmemptr[2] = '8';
45 textmemptr[3] = 0x0f;
46 textmemptr[4] = '6';
47 textmemptr[5] = 0x0f;
48 textmemptr[6] = '_';
49 textmemptr[7] = 0x0f;
50 textmemptr[8] = '6';
51 textmemptr[9] = 0x0f;
52 textmemptr[10] = '4';
53 textmemptr[11] = 0x0f;
56 unsigned init_arch ()
60 if (!gdt_install ())
61 return 0;
62 draw_arch ();
63 if (!idt_install ())
64 return 0;
66 if (!isrs_install ())
67 return 0;
69 if (!irq_install ())
70 return 0;
72 return 1;
75 void halt ()
77 __asm__ __volatile__("hlt");