Mercurial > hg > Members > taiki > original_os
view withGRUB2Kernel/kernel.cbc @ 20:4205fb316c14 default tip
add memo files
author | Taiki TAIRA <e095767@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 15 Oct 2012 07:33:04 +0900 |
parents | acdc2c21996a |
children |
line wrap: on
line source
__code memory(int state); __code kernel(int state); void init(int state); __code put_to_vmem(unsigned char* str, unsigned short *video) { char c; if ((c=*(str++))!=0) { *video++ = (0x0E << 8) | c; goto put_to_vmem(str, video); } else { goto kernel(3); } } __code putchar(int state) { unsigned short *video = (unsigned short *)0xb8000; unsigned char *str = (unsigned char *)"hello,world"; goto put_to_vmem(str, video); goto kernel(2); } __code kernel(int state) { switch(state) { case 1: goto putchar(3); break; case 2: goto memory(state); break; } goto kernel(state); } __code memory(int state) { if (state == 1) { goto kernel(state); } init(state); } void init(int state) { goto kernel(state); } int kmain(unsigned long magic, unsigned long addr) { int state = 1; init(state); return 0; }