From 5d34fa2a489940f19ee6c4728e4b11b6d8ffad01 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 31 May 2019 11:45:42 -0400 Subject: -initrd fs.img, ramdisk.c, file system --- usys.pl | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 usys.pl (limited to 'usys.pl') diff --git a/usys.pl b/usys.pl new file mode 100755 index 0000000..f8d47d5 --- /dev/null +++ b/usys.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl -w + +# Generate usys.S, the stubs for syscalls. + +print "# generated by usys.pl - do not edit\n"; + +print "#include \"syscall.h\"\n"; + +sub entry { + my $name = shift; + print ".global $name\n"; + print "${name}:\n"; + print " li a7, SYS_${name}\n"; + print " ecall\n"; + print " ret\n"; +} + +entry("fork"); +entry("exit"); +entry("wait"); +entry("pipe"); +entry("read"); +entry("write"); +entry("close"); +entry("kill"); +entry("exec"); +entry("open"); +entry("mknod"); +entry("unlink"); +entry("fstat"); +entry("link"); +entry("mkdir"); +entry("chdir"); +entry("dup"); +entry("getpid"); +entry("sbrk"); +entry("sleep"); +entry("uptime"); -- cgit v1.2.3