Code: Select all
// HELLO WORLD EXAMPLE
const MESSAGE:[b8] = "Hello World";
func main() -> sys_exit {
stdout = MESSAGE;
return 0;
}
// PART OF KERNEL MAIN EXAMPLE
func error(val: b8) -> hlt {
0xb8000 = "ERR: ";
0xb800a = val;
}
func check_multiboot() {
if (eax != 0x36d76289) {
error("M");
}
return;
}
func main32() -> hlt {
check_multiboot();
}
// MULTIBOOT HEADER EXAMPLE
#pragma section .multiboot_header
#define MULTIBOOT2 0xe85250d6
#define i386 0
#define FRAME_BUFFER_TAG 5
{
const MAGIC:b32 = MULTIBOOT2;
const ARCHITECTURE:b32 = i386;
}
{
const TAG_TYPE:b16 = FRAME_BUFFER_TAG;
const OPTIONAL:b16 = 0;
const WIDTH:b32 = 500;
const HEIGHT:b32 = 500;
const DEPTH:b32 = 32;
}
{
const END0:b16 = 0;
const END1:b16 = 0;
const END2:b16 = 0;
}