diff options
| author | Michal Idziorek <m.i@gmx.at> | 2015-05-13 16:18:24 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2015-05-13 16:18:24 +0200 |
| commit | 9a60edf72a3112adae4a914134da1adaf472ad5d (patch) | |
| tree | 64fe18ef416160244ad7dc80875e9f5a47390971 /asm/multiboot.s | |
| parent | 39d0c5ad74f69ef368d6f83e4eac575e76060eb4 (diff) | |
fixing gdt and interrupts
Diffstat (limited to 'asm/multiboot.s')
| -rw-r--r-- | asm/multiboot.s | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/asm/multiboot.s b/asm/multiboot.s index a497e18..21df7bb 100644 --- a/asm/multiboot.s +++ b/asm/multiboot.s @@ -45,6 +45,8 @@ stack_top: # doesn't make sense to return from this function as the bootloader is gone. .section .text .global _start +.global stack_top +.global stack_bottom .type _start, @function _start: # Welcome to kernel mode! We now have sufficient code for the bootloader to @@ -67,6 +69,8 @@ _start: # a stack. Note that the processor is not fully initialized yet and stuff # such as floating point instructions are not available yet. + lgdt gdt_descriptor #load descriptor table! + # To set up a stack, we simply set the esp register to point to the top of # our stack (as it grows downwards). movl $stack_top, %esp @@ -77,6 +81,20 @@ _start: push %ebx #pass address of the multiboot information data structure push %eax #pass eax, so kernel can check for magic number + + + reloadSegments: + #Reload CS register containing code selector: + jmp $0x08,$reload_CS # 0x08 points at the new code selector + + reload_CS: + mov $0x10, %ax + mov %ax, %ds + mov %ax, %es + mov %ax, %fs + mov %ax, %gs + mov %ax, %ss + call kernel_main # In case the function returns, we'll want to put the computer into an |
