1
0
aedrix-kernel/kernel/hello.c

24 lines
548 B
C
Raw Normal View History

2012-09-03 23:44:36 -04:00
#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;
}