cynix

x86 UNIX-like OS
git clone git://git.2f30.org/cynix
Log | Files | Refs | README | LICENSE

init.c (458B)


      1 /*
      2  *  core/init.c
      3  *
      4  *  Copyright (C) 2009 stateless
      5  */
      6 
      7 #include <multiboot.h>
      8 #include <common.h>
      9 
     10 extern int main(void);
     11 extern int puts(const char *s);
     12 
     13 unsigned long int addr_info = 0, initial_esp = 0;
     14 
     15 void
     16 init(unsigned long int magic, unsigned long int addr, unsigned long int initial_esp_arg)
     17 {
     18 	if (magic != MULTIBOOT_BOOTLOADER_MAGIC)
     19 		panic("0x%lx invalid magic number", magic);
     20 	addr_info = addr;
     21 	initial_esp = initial_esp_arg;
     22 	main();
     23 }
     24