diff options
Diffstat (limited to 'kernel/arch')
| -rw-r--r-- | kernel/arch/i386/boot.asm | 13 | ||||
| -rw-r--r-- | kernel/arch/i386/isr_handler.cpp | 2 | ||||
| -rw-r--r-- | kernel/arch/i386/linker.ld | 5 | 
3 files changed, 17 insertions, 3 deletions
| diff --git a/kernel/arch/i386/boot.asm b/kernel/arch/i386/boot.asm index b5dfe11..494d3ba 100644 --- a/kernel/arch/i386/boot.asm +++ b/kernel/arch/i386/boot.asm @@ -30,10 +30,19 @@ _start:      ; setup stack
      mov esp, stack_top
 -    ; get multiboot header data (for memory map)
 -    extern multiboot_main
 +    ; push the multiboot header data into the stack for later use
      push eax
      push ebx
 +
 +    ; setup paging (to map kernel to the higher half)
 +    ;mov eax, 0
 +    ;mov cr3, eax
 +    ;mov eax, cr0
 +    ;or eax, 0x80000001
 +    ;mov cr0, eax
 +
 +    ; get multiboot header data (for memory map)
 +    extern multiboot_main
      call multiboot_main
      extern _init
 diff --git a/kernel/arch/i386/isr_handler.cpp b/kernel/arch/i386/isr_handler.cpp index ba825dd..ac8fb49 100644 --- a/kernel/arch/i386/isr_handler.cpp +++ b/kernel/arch/i386/isr_handler.cpp @@ -10,7 +10,7 @@  extern "C" void exception_handler(int e) {
      //unsigned char errorcode[2]{((unsigned char) e) + 48};
      //terminal_initialize();
 -	printf("Exception\n");
 +	printf("Exception %x\n", e);
  }
  #define PS2_DATA 0x60
 diff --git a/kernel/arch/i386/linker.ld b/kernel/arch/i386/linker.ld index 24cfa84..bac95d2 100644 --- a/kernel/arch/i386/linker.ld +++ b/kernel/arch/i386/linker.ld @@ -5,6 +5,9 @@ SECTIONS  {
      . = 1M;
 +    /* Used to get the beginning and end address of the kernel */
 +    _begin = .;
 +
      /* code. multiboot header comes first */
      .text BLOCK(4K) : ALIGN(4K)
      {
 @@ -30,4 +33,6 @@ SECTIONS          *(COMMON)
          *(.bss)
      }
 +
 +    _end = .;
  }
\ No newline at end of file | 
