aboutsummaryrefslogtreecommitdiff
path: root/tests/simple_uart/hello.c
blob: 30719e0810db31fd4ae2de3db40d7595baea66db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* compile with
 *	riscv64-unknown-elf-gcc -ffreestanding -nostdlib -Wl,-Ttext=0 -march=rv64i -mabi=lp64 -O2 hello.c -o simple_hello
 *	xxd --include simple_hello
 */
void _start()
{
	/* relies on hard-coded system, good enough for this simple test */
	volatile char *uart = (char *)4096;
	*uart = 'H';
	*uart = 'e';
	*uart = 'l';
	*uart = 'l';
	*uart = 'o';
	*uart = '!';
	*uart = '\n';

	asm ("ebreak\n");
}