37 lines
797 B
C
37 lines
797 B
C
// volatile unsigned int *uart = (unsigned int *)0x10000000;
|
|
//
|
|
// void _start() __attribute__((naked, section(".text")));
|
|
//
|
|
// #define NCPU 1
|
|
// __attribute__((aligned(16))) char stack0[4096 * NCPU];
|
|
//
|
|
// void uart_putc(char c) { *uart = c; }
|
|
//
|
|
// void uart_print(char *str, int len) {
|
|
// for (int i = 0; i < len; i++) {
|
|
// uart_putc(str[i]);
|
|
// }
|
|
// }
|
|
//
|
|
// // void _start() {
|
|
// // void _entry() {
|
|
// // asm volatile("la sp, stack0");
|
|
// //
|
|
// // *uart = 'H';
|
|
// //
|
|
// // // *uart = 'i';
|
|
// // // *uart = '\n';
|
|
// // uart_putc('h');
|
|
// // // uart_print("Hey", 3);
|
|
// //
|
|
// // while (1) {};
|
|
// // }
|
|
// //
|
|
// // int main(void) {
|
|
// //
|
|
// // }
|
|
// int strlen(char *str) {
|
|
// int cnt = 0;
|
|
// while (*str != '\n') cnt++;
|
|
// return cnt;
|
|
// }
|