raspberry3_bare/hello.c

29 lines
521 B
C
Raw Normal View History

2022-03-14 07:46:32 +01:00
#include "uart.h"
2022-03-15 23:09:55 +01:00
#include "mbox.h"
2022-03-14 07:46:32 +01:00
int kernelmain(void) {
init_uart();
2022-03-15 23:09:55 +01:00
mbox[0] = 8 * 4;
mbox[1] = MBOX_REQUEST;
mbox[2] = MBOX_TAG_GETVCOREMEM;
mbox[3] = 8;
mbox[4] = 0;
mbox[5] = 0;
mbox[6] = 0;
mbox[7] = MBOX_TAG_LAST;
if(mbox_call(MBOX_CH_PROP, mbox)){
puts("videocore start at 0x");
printhex(mbox[5]);
puts(" - ");
int mem = mbox[6]/1024/1024;
printdec(mem);
puts(" Mo\n");
}else{
puts("Error getting videocore mem\n");
}
2022-03-14 20:28:46 +01:00
puts("Hello world\n");
2022-03-14 07:46:32 +01:00
return 0;
}