Code: Select all
void print(char* text) {
unsigned char* buffer = (unsigned char*) 0xb800;
buffer[0] = text[0];
}
void KernelMain() {
print("welcome");
while(1);
}
Code: Select all
$ watcom/binl/wcc -s -wx -d0 -fr -ms -zl -fo=main.o main.c
Code: Select all
$ watcom/binl/wlink FILE main.o NAME output.bin OUTPUT RAW OPTION NODEFAULTLIBS, START=KernelMain_
Code: Select all
$ hexdump -Cv output.bin
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 53 56 89 c3 be 00 b8 8a 1f 88 1c 5e 5b c3 b8 00 |SV.........^[...|
00000020 77 65 6c 63 6f 6d 65 00 |welcome.|
00000028