From 46bb1d3157f9ad575c83a4bfa1e32b0d21bc8546 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 14 Sep 2019 01:42:29 -0700 Subject: 5650 - support a second OS: soso https://github.com/ozkl/soso + Much smaller than Linux; builds instantly + Supports graphics - No network support - Doesn't work on a cloud server (yet?) --- init.soso | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 init.soso (limited to 'init.soso') diff --git a/init.soso b/init.soso new file mode 100644 index 00000000..c24709b1 --- /dev/null +++ b/init.soso @@ -0,0 +1,40 @@ +# Some OS-specific preliminaries for Soso. + +# Memory layout +# +# 0x40000000 - 0x40001ffff - for ELF code+data +# 0x40002000 - 0x401ffffff - for heap +== code 0x40000000 +== data 0x40001000 + +# Syscalls +# +# We don't have libc, so we need to know Soso's precise syscall layout. +# https://github.com/ozkl/soso/blob/master/kernel/syscalltable.h +== code + +syscall_exit: # status/ebx : int + b8/copy-to-eax 8/imm32 + cd/syscall 0x80/imm8 + +syscall_read: # fd/ebx : int, buf/ecx : address, size/edx : int -> nbytes-or-error/eax : int + b8/copy-to-eax 2/imm32 + cd/syscall 0x80/imm8 + c3/return + +syscall_write: # fd/ebx : int, buf/ecx : address, size/edx : int -> nbytes-or-error/eax : int + b8/copy-to-eax 3/imm32 + cd/syscall 0x80/imm8 + c3/return + +syscall_open: # filename/ebx : (address null-terminated-string), flags/ecx : int -> fd-or-error/eax : int + b8/copy-to-eax 0/imm32 + cd/syscall 0x80/imm8 + c3/return + +syscall_close: # fd/ebx : int -> status/eax + b8/copy-to-eax 1/imm32 + cd/syscall 0x80/imm8 + c3/return + +# anonymous mmap not implemented -- cgit 1.4.1-2-gfad0