Skip to content

Latest commit

 

History

History
83 lines (65 loc) · 1.44 KB

README.md

File metadata and controls

83 lines (65 loc) · 1.44 KB

MayOS

A toy kernel which comes with some user routines. (x86 based)

mayos

Build requirements

Platform: Linux

  • gnu make
  • nasm
  • gcc
  • binutils(ld, objcopy)
  • mkfs
  • bochs 2.6.7+

How to compile

git clone https://github.com/Explainaur/MayOS.git
cd MayOS
mkdir bin
cd MayOS/src
make
cd ..
make run    # run with bochs

Syscalls list

typedef enum _SYSCALL_NR {
    SYS_GETPID,
    SYS_WRITE,
    SYS_MALLOC,
    SYS_FREE,
    SYS_FORK,
    SYS_READ,
    SYS_PUTCHAR,
    SYS_CLEAR,
    SYS_GETCWD,
    SYS_OPEN,
    SYS_CLOSE,
    SYS_LSEEK,
    SYS_UNLINK,
    SYS_MKDIR,
    SYS_OPENDIR,
    SYS_CLOSEDIR,
    SYS_CHDIR,
    SYS_RMDIR,
    SYS_READDIR,
    SYS_REWINDDIR,
    SYS_STAT,
    SYS_PS,
    SYS_EXECV,
    SYS_EXIT,
    SYS_WAIT
} SYSCALL_NR;

How to write user program for MayOS

The MayOS sdk's head file is in the include/user and stdio.h string.h. You can write your own program and link with the libMay.a. You can compile it by running ./compile.sh bin.

For Example:

cd ./src/user
./compile ./cat/cat

Then the cat ELF file will be compiled.

License

GNU General Public License Version 3

References