ysyx-workbench/abstract-machine/am/src/platform/nemu/trm.c
xinyangli 961ba84a54
Some checks failed
Build abstract machine with nix / build-abstract-machine (push) Failing after 53s
Run CTests within npc / npc-test (push) Has been cancelled
nemu: support yield()
2024-07-25 16:47:29 +08:00

26 lines
419 B
C

#include <am.h>
#include <nemu.h>
extern char _heap_start;
int main(const char *args);
Area heap = RANGE(&_heap_start, PMEM_END);
#ifndef MAINARGS
#define MAINARGS "i"
#endif
static const char mainargs[] = MAINARGS;
void putch(char ch) { outb(SERIAL_PORT, ch); }
void halt(int code) {
nemu_trap(code);
// should not reach here
while (1)
;
}
void _trm_init() {
int ret = main(mainargs);
halt(ret);
}