Advertisement
Guest User

Correct code

a guest
Feb 19th, 2019
1,111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bits 32
  2.  
  3. %include "gdt.inc"
  4. %include "idt.inc"
  5.  
  6. global start
  7. extern kernelmain
  8.  
  9. start:
  10.     mov esp, _sys_stack  
  11.     jmp stublet
  12.  
  13. SECTION .multiboot
  14. ALIGN 4
  15. mboot:
  16.     MULTIBOOT_PAGE_ALIGN   equ 1<<0
  17.     MULTIBOOT_MEMORY_INFO   equ 1<<1
  18.     MULTIBOOT_AOUT_KLUDGE   equ 1<<16
  19.     MULTIBOOT_HEADER_MAGIC   equ 0x1BADB002
  20.     MULTIBOOT_HEADER_FLAGS   equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
  21.     MULTIBOOT_CHECKSUM   equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
  22.     EXTERN code, bss, end
  23.  
  24.     dd MULTIBOOT_HEADER_MAGIC
  25.     dd MULTIBOOT_HEADER_FLAGS
  26.     dd MULTIBOOT_CHECKSUM
  27.  
  28.     call InstallGDT
  29.  
  30.     call kernelmain
  31. stublet:
  32.     jmp $
  33.  
  34. SECTION .bss
  35.     resb 8192            
  36. _sys_stack:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement