### Install Build Tools with msk Source: https://github.com/klange/toaruos/blob/master/base/home/local/README.md Use the `msk` package manager to install the build-essential toolchain for development. ```bash sudo msk install build-essential ``` -------------------------------- ### Install Games with msk Source: https://github.com/klange/toaruos/blob/master/base/home/local/README.md Use the `msk` package manager to install games like Doom and Quake. ```bash sudo msk install doom quake ``` -------------------------------- ### Clone ToaruOS Repository and Setup Toolchain Source: https://github.com/klange/toaruos/blob/master/util/docker/README.md Clone the ToaruOS repository, set up the build toolchain, and prepare the build environment. This includes a loop to manage directory conflicts during binutils configuration. ```bash cd git clone --recurse-submodules https://github.com/toaruos/misaka cd misaka util/build-toolchain.sh cd util/build/binutils while [[ -e confdir3/confdir3 ]]; do mv confdir3/confdir3 confdir3a; rmdir confdir3; mv confdir3a confdir3; done; rmdir confdir3 cd ../../.. mv local /root/gcc_local cd /root rm -rf misaka ``` -------------------------------- ### Install Python to ToaruOS Filesystem Source: https://github.com/klange/toaruos/wiki/How-to-Python Install the built Python components into the ToaruOS filesystem base directory using `DESTDIR`. ```bash make DESTDIR="$TOOLCHAIN/../base" commoninstall bininstall ``` -------------------------------- ### Clean Up Python Installation Source: https://github.com/klange/toaruos/wiki/How-to-Python Run this script after installation to remove unnecessary files and reduce the size of the Python installation on ToaruOS. ```bash util/fix-python.sh ``` -------------------------------- ### Transfer Screenshot from VM to Host Source: https://github.com/klange/toaruos/wiki/Screenshots Use this command on the host machine to listen for a screenshot file and convert it to PNG. Ensure netcat is installed on the host. ```bash nc -l 9999 > screenshot.tga; convert screenshot.tga screenshot.png ``` -------------------------------- ### Create a Simple 'Hello World' Kernel Module Source: https://github.com/klange/toaruos/wiki/Modules This module prints 'hello world' to the kernel debug log upon loading. It requires including `` and ``. ```c #include #include static int init(void) { debug_print(NOTICE, "hello world"); return 0; } static int fini(void) { return 0; } MODULE_DEF(hello, init, fini); ``` -------------------------------- ### Run ToaruOS in QEMU Source: https://github.com/klange/toaruos/blob/master/README.md Recommended QEMU command line for ToaruOS development. Replace KVM acceleration options based on your host platform. Note that QEMU options may change between versions. ```bash qemu-system-x86_64 -enable-kvm -m 1G -device AC97 -cdrom image.iso -smp 2 ``` -------------------------------- ### Boot ToaruOS with Grub Source: https://github.com/klange/toaruos/blob/master/README.md Commands to boot ToaruOS using Grub, supporting Multiboot and Multiboot 2 specifications. Ensure correct paths to the kernel and ramdisk are provided. ```bash multiboot2 /path/to/misaka-kernel root=/dev/ram0 migrate vid=auto start=live-session module2 /path/to/ramdisk.igz set gfxpayload=keep ``` -------------------------------- ### Build ToaruOS with Docker Source: https://github.com/klange/toaruos/blob/master/README.md Use this command to build ToaruOS from source within a Docker container. Ensure the ToaruOS repository is mounted at /root/misaka. This process requires cloning the repository and initializing submodules. ```bash git clone https://github.com/klange/toaruos cd toaruos git submodule update --init kuroko git submodule update --init bim docker pull toaruos/build-tools:1.99.x docker run -v `pwd`:/root/misaka -w /root/misaka -e LANG=C.UTF-8 -t toaruos/build-tools:1.99.x util/build-in-docker.sh ``` -------------------------------- ### Build ToaruOS Docker Image Source: https://github.com/klange/toaruos/blob/master/util/docker/README.md Build the base Docker image for ToaruOS development from the Dockerfile. ```bash docker build . ``` -------------------------------- ### Activate ToaruOS Toolchain Source: https://github.com/klange/toaruos/wiki/How-to-Python Source this script to add the ToaruOS cross-compilation toolchain to your PATH. ```bash source util/activate.sh ``` -------------------------------- ### Configure Python Build Source: https://github.com/klange/toaruos/wiki/How-to-Python Configure the Python build with specific options for cross-compilation on ToaruOS. Ensure all specified flags are necessary for your build environment. ```bash ./configure --disable-ipv6 --enable-shared --host=i686-pc-toaru --build=i686 --prefix=/usr/python ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_func_dlopen=yes ac_cv_func_wait3=no ac_cv_var_tzname=no ac_cv_func_unsetenv=no ac_cv_var_putenv=no ac_cv_header_sys_lock_h=no ac_cv_header_sys_param_h=no ac_cv_header_sys_resource_h=no ac_cv_header_libintl_h=no ac_cv_func_sigaction=no ``` -------------------------------- ### Extend the Debug Shell with a New Command Source: https://github.com/klange/toaruos/wiki/Modules This module adds a new command, 'hello', to the debug shell. It uses macros from `` to define and bind the shell function. The module depends on the 'debugshell' module. ```c #include #include DEFINE_SHELL_FUNCTION(hello, "Print 'hello world'") { fs_printf(tty, "hello world\n"); return 0; } static int init(void) { BIND_SHELL_FUNCTION(hello); return 0; } static int fini(void) { return 0; } MODULE_DEF(hello, init, fini); MODULE_DEPENDS(debugshell); ``` -------------------------------- ### Send Screenshot from ToaruOS VM Source: https://github.com/klange/toaruos/wiki/Screenshots Use this command within the ToaruOS VM to send the captured screenshot file over the network to the listening host. This requires netcat to be available in the VM. ```bash cat /tmp/screenshot.tga > /dev/net/10.0.2.1:9999 ``` -------------------------------- ### Old VFS Virtual Function Types (C) Source: https://github.com/klange/toaruos/wiki/New-VFS Defines the type aliases for various virtual functions used in the previous VFS implementation. These cover read, write, open, close, readdir, finddir, create, unlink, mkdir, ioctl, get_size, and chmod operations. ```c typedef uint32_t (*read_type_t) (struct fs_node *, uint32_t, uint32_t, uint8_t *); typedef uint32_t (*write_type_t) (struct fs_node *, uint32_t, uint32_t, uint8_t *); typedef void (*open_type_t) (struct fs_node *, unsigned int flags); typedef void (*close_type_t) (struct fs_node *); typedef struct dirent *(*readdir_type_t) (struct fs_node *, uint32_t); typedef struct fs_node *(*finddir_type_t) (struct fs_node *, char *name); typedef void (*create_type_t) (struct fs_node *, char *name, uint16_t permission); typedef void (*unlink_type_t) (struct fs_node *, char *name); typedef void (*mkdir_type_t) (struct fs_node *, char *name, uint16_t permission); typedef int (*ioctl_type_t) (struct fs_node *, int request, void * argp); typedef int (*get_size_type_t) (struct fs_node *); typedef int (*chmod_type_t) (struct fs_node *, int mode); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.