summaryrefslogtreecommitdiff
path: root/src/stem/loader_.asm
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-02-03 15:22:30 +0100
committerAlexis211 <alexis211@gmail.com>2010-02-03 15:22:30 +0100
commit9c4310651a91e64c10a17f3190c895a49096aeb1 (patch)
treeaf87d115512249458f80f184d53db403c3f0bb0f /src/stem/loader_.asm
parent7f72a900c12ba62db12df0872cb66f79a27aa9d9 (diff)
downloadTCE-9c4310651a91e64c10a17f3190c895a49096aeb1.tar.gz
TCE-9c4310651a91e64c10a17f3190c895a49096aeb1.zip
Reogranization
Diffstat (limited to 'src/stem/loader_.asm')
-rw-r--r--src/stem/loader_.asm63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/stem/loader_.asm b/src/stem/loader_.asm
deleted file mode 100644
index e1031b4..0000000
--- a/src/stem/loader_.asm
+++ /dev/null
@@ -1,63 +0,0 @@
-[GLOBAL loader] ; making entry point visible to linker
-[EXTERN kmain] ; kmain is defined in kmain.c
-
-STACKSIZE equ 0x4000 ; that's 16k.
-
-; setting up the Multiboot header - see GRUB docs for details
-MODULEALIGN equ 1<<0 ; align loaded modules on page boundaries
-MEMINFO equ 1<<1 ; provide memory map
-FLAGS equ MODULEALIGN | MEMINFO ; this is the Multiboot 'flag' field
-MAGIC equ 0x1BADB002 ; 'magic number' lets bootloader find the header
-CHECKSUM equ -(MAGIC + FLAGS) ; checksum required
-
-section .text
-align 4
-MultiBootHeader:
- dd MAGIC
- dd FLAGS
- dd CHECKSUM
-
-section .setup
-loader: ;here, we load our false GDT, used for having the kernel in higher half
- lgdt [trickgdt]
- mov cx, 0x10;
- mov ds, cx;
- mov es, cx;
- mov fs, cx;
- mov gs, cx;
- mov ss, cx;
-
- jmp 0x08:higherhalf
-
-section .text
-higherhalf: ; now we're running in higher half
-
- mov esp, stack+STACKSIZE ; set up the stack
- push eax ; pass Multiboot magic number
- add ebx, 0xE0000000 ; update the MB info structure so that it is in the new seg
- push ebx ; pass Multiboot info structure
-
- call kmain ; call kernel proper
-
- cli ; disable interupts
-hang:
- hlt ; halt machine should kernel return
- jmp hang
-
-[section .setup] ; this is included in the .setup section, so that it thinks it is at 0x00100000
-
-trickgdt: ; our false GDT
- dw gdt_end - gdt - 1 ; gdt limit
- dd gdt ; gdt base
-
-gdt:
- dd 0, 0 ; null GDT entry
- db 0xFF, 0xFF, 0, 0, 0, 10011010b, 11001111b, 0x20 ; kernel code segment
- db 0xFF, 0xFF, 0, 0, 0, 10010010b, 11001111b, 0x20 ; kernel data segment
-
-gdt_end:
-
-[section .bss]
-align 32
-stack:
- resb STACKSIZE ; reserve 16k stack on a quadword boundary