1
0

Initial commit

This commit is contained in:
2012-09-03 23:44:36 -04:00
commit 4be5ceeec6
6 changed files with 107 additions and 0 deletions

3
kernel/Makefile.inc Normal file
View File

@ -0,0 +1,3 @@
KERNEL_PREFIX = kernel
KOBJS += $(KERNEL_PREFIX)/hello.o

23
kernel/hello.c Normal file
View File

@ -0,0 +1,23 @@
#define SERIAL_BASE 0x16000000
#define SERIAL_FLAG_REGISTER 0x18
#define SERIAL_BUFFER_FULL (1 << 5)
void putc (char c)
{
/* Wait until the serial buffer is empty */
while (*(volatile unsigned long*)(SERIAL_BASE + SERIAL_FLAG_REGISTER)
& (SERIAL_BUFFER_FULL));
/* Put our character, c, into the serial buffer */
*(volatile unsigned long*)SERIAL_BASE = c;
}
void puts (const char * str)
{
while (*str) putc (*str++);
}
int main (void)
{
puts ("hello, world!\n");
return 0;
}