I was looking at my C notes and see that vm86 is a syscall
http://linux.die.net/man/2/vm86
#include <syscall.h>
#include <sys/vm86.h>
int vm86(unsigned long fn, struct vm86plus_struct *v86){
return syscall(SYS_vm86,fn,v86);
}
(the older xvesa may need vm86old though?)
I've been seriously considering setting up my fast boot C implementation as a full time project if any pupngoers are interested, but only to mount the file systems, set some environment variables and start basic X... leaving the b.s. stuff that distro builders often change to be done inside X.
This will require several kernel parameters to be set such as:
mounts=/dev/sda1:ext3,/dev/sda2:ext4
swap=/mnt/sda1/pupngo/pupngo.swp #or /dev/sd[a-z][1-9]*
unions_ro=/mnt/sda1/pupngo/pup.sfs,/mnt/sda1/pupngo/devx.sfs
#unions will be layered in order they appear
union_rw=/mnt/sda1/pupngo/save.4fs
X=Xorg #can be Xvesa, xfbdev,... or something else entirely
Xscreen=640x480x16 #used by Xvesa -screen, todo accept "max"
LANG=en_US #any supported language
kb=us #any supported kb config
desktop=rox #none, jwm, pcmanfm, thunor, idesk, gnome, kde, ...
wm=jwm #icewm, mcwm, xdm, gdm, slim ... (window/display manager)
other parameters matching var=value will be set as env variables
This shouldn't be too difficult to accommodate in the installer, since the variables set in the gtkdialog wrapper can be used when writing the menu.cfg (or whatever gui/bootloader combo is chosen) ... the boot cd can have a set(s) of default parameters
possible future params:
user=root #spot, ... user defined?
toram=all # all=load all sfs in ram, 1 (only first sfs) 2, 3,... ?
module_dir=/lib/modules/3.8
modules=subdir_path/somemodule.ko,.../another.ko
#note, modules needed for boot should be builtin if possible ... the 3.8 kernel makes it much easier to load modules using only the filename without needing to memmap the file first (finit_module could be backported)
Normal init processes have the ability to halt, shutdown and reboot. I was thinking this could be set up by reading a file or fifo in a loop at the end of the init that could be written to by simply echoing to /tmp/.init ... thus the traditional command to shutdown/restart: init 6 ... could be emulated by echo $1 > /tmp/.init
I am trying to keep everything as libc independent as possible, to the point of writing my own implementations of many standard functions like fprintf, printf, strlen, strcmp, strncmp (todo: fork and exec* via syscalls)