kernel

hobby kernel
git clone git://git.evenfri.duckdns.org/kernel.git
Log | Files | Refs | README | LICENSE

boot.s (612B)


      1 /* declare constants for the multiboot header. */
      2 .set ALIGN,    1<<0             
      3 .set MEMINFO,  1<<1             
      4 .set FLAGS,    ALIGN | MEMINFO  
      5 .set MAGIC,    0x1BADB002      
      6 .set CHECKSUM, -(MAGIC + FLAGS) 
      7 
      8 .section .multiboot
      9 .align 4
     10 .long MAGIC
     11 .long FLAGS
     12 .long CHECKSUM
     13 
     14 .section .bss
     15 .align 16
     16 stack_bottom:
     17 .skip 16384 /* 16 KiB */
     18 stack_top:
     19 
     20 .section .text
     21 .global _start
     22 .type _start, @function
     23 _start:
     24   /* setup stack */
     25   mov $stack_top, %esp
     26 
     27   /* enter the high-level kernel */
     28   
     29   push %ebx   
     30   push %eax     
     31  
     32   call start_kernel
     33     
     34   cli
     35 1:  hlt
     36   jmp 1b
     37 
     38 .size _start, . - _start