1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-02-06 00:05:02 +00:00
Files
antonblanchard.microwatt/rust_lib_demo/hello_world.c
Benjamin Herrenschmidt a87b86e54f console: Replace putstr with puts
It makes things a bit more standard and a bit nicer to read
without all those strlen(). Also console.c takes care of adding
the carriage returns before the linefeeds.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2020-05-15 20:48:47 +10:00

38 lines
413 B
C

#include <stdint.h>
#include <stdbool.h>
#include "console.h"
void rust_main();
void crash()
{
void (*fun_ptr)() = (void(*)()) 0xdeadbeef;
(*fun_ptr)();
}
void init_bss()
{
extern int _bss, _ebss;
int *p = &_bss;
while (p < &_ebss) {
*p++ = 0;
}
}
#define HELLO_WORLD "Hello World\n"
int main(void)
{
init_bss();
potato_uart_init();
puts(HELLO_WORLD);
rust_main();
crash();
while (1)
;
}