1. Introduction

1.1. Modules Overview

The code base of haskus-system is becoming quite large. This page gives an overview of the different modules.

1.1.1. Interface with the Linux kernel

haskus-system provides foreign primops to call Linux system calls from Haskell code without going through the libc. In addition to basic system calls, it provides wrappers for some Linux subsystems/features accessible through multiplexing syscalls (e.g., ioctl) or through specific file systems (e.g., procfs, sysfs).

1.1.2. Formats

haskus-system provides support for some file formats (e.g., ELF, DWARF, CPIO) and some file system formats (e.g., ISO9660). These can be used to interact with Linux (e.g., to look up for functions in the vDSO ELF image), to build initramfs images or bootable disk images, etc.

1.1.3. Architectures

haskus-system provides architecture specific modules (currently only for x86-64), in particular the thin architecture specific layer to call Linux system calls. Additionally, Haskus has a dictionnary of x86 instructions; it is currently used to implement a disassembler and could be used to implement assemblers, analyzers, emulators, etc. A wrapper for the x86’s cpuid instruction is also provided.

1.1.4. System interface

haskus-system provides modules to interact with the system: input devices, display devices, etc. These modules are used to easily build a custom system without dealing directly with the low-level Linux interface. It also provides a custom monad with common features for system programming (logging, etc.).