The libmsys library is free software. See COPYING for details.

libmsys is a low-level library which attempts to provide access to
MenuetOS system calls while hiding some of the arcane details from C
programmers.

To compile the library read the INSTALL file.
If you don't have gcc read the docs/Porting file.

The library is automatically linked into programs by the mengcc compiler.

Compile tests/example.c as follows.

  mengcc -Wall -Werror -c example.c
  menld -s -o example example.o

Also a limited emulation layer is available for compiling MenuetOS apps as
native executables on some host system e.g. GNU/Linux. To use it just use
the emenld linker:

 emenld -s -o em_example example.o
 ./em_example

This will produce a file "emlog.txt" in the current directory, containing
details of emulated system calls the program called. Be careful as this
logfile can grow to many megabytes in seconds as your program executes its
main loop.

Note that you can share object (*.o) files between menld and emenld:

  mengcc -Wall -Werror -c example.c
  menld -s -o example example.o
  emenld -s -o em_example example.o
  ./em_example

But in practice, you'll probably want to use the debugger on the native
executable so the sequence is more like:

  mengcc -g -Wall -Werror -c example.c
  menld -s -o example example.o
  emenld -o em_example example.o
  gdb ex_example

This emulation is not intended as a replacement for use of full emulators
like Bochs, but it should make writing C programs for MenuetOS a lot
easier.

Using optimization will generally lead to smaller executables (although
still much bigger than those written in assembly!).

Read docs/Manual.txt for information about the functions.
