Added libc functions
This commit is contained in:
13
kernel.c
13
kernel.c
@@ -1,4 +1,5 @@
|
||||
#include "kernel.h"
|
||||
#include "common.h"
|
||||
|
||||
extern uint8_t __bss[], __bss_end[], __stack_top[];
|
||||
|
||||
@@ -32,10 +33,14 @@ void putchar(char c)
|
||||
|
||||
void kernel_main(void)
|
||||
{
|
||||
const char *s = "\n\nHello World!\n";
|
||||
for (int i = 0; s[i] != '\0'; i++) {
|
||||
putchar(s[i]);
|
||||
}
|
||||
const char *s = "Hello World!";
|
||||
printf("\nString = '%s'\n", s);
|
||||
printf("\nPositive Integer = %d\n", 42);
|
||||
printf("\nNegative Integer = %d\n", -42);
|
||||
printf("\nHexadecimal = %x\n", 0xdeadbeef);
|
||||
|
||||
printf("offsetof(sbiret, error) = %x\n", offsetof(sbiret, error));
|
||||
printf("offsetof(sbiret, value) = %x\n", offsetof(sbiret, value));
|
||||
|
||||
while(1) {
|
||||
// wfi -> wait for interrupt
|
||||
|
||||
Reference in New Issue
Block a user