<CHAPTER ID="Internals ">
<TITLE>Getting started with openMosix internals</TITLE>
<SECT1><TITLE>Introduction</TITLE>
<PARA>this part has been written by Amit Shah</para>

<para>
There's not much documentation available right now for the kernel. I hope to 
write some in the coming weeks. Anyways, here's how the sources are laid out:
</para>
<para>
The openMosix code resides largely in hpc/ and include/hpc. There are lots of 
patches to the core kernel files everywhere, right from the arch/i386 
directories to mm/, fs/, etc. You need to read up the code which interests 
you and think that would matter for the present situation (that shouldn't be 
a problem, since you've done kernel coding).
</para>
<para>
here's what you should expect in each of the source files:
<itemizedlist>
<listitem><para>

hpc/badops.c: one file to handle all the bad operations: mostly return err 
codes
</para></listitem>
<listitem><para>
hpc/balance.c: The load balancer code (load + mem usage + n/w usage)
</para></listitem>
<listitem><para>

hpc/comm.c: The intra-cluster communication setup
</para></listitem>
<listitem><para>

hpc/config.c: The config code for openMosix: after you run the startup script
</para></listitem>
<listitem><para>

hpc/decay.c: decay (age) the stats and info collected from other nodes
</para></listitem>
<listitem><para>

hpc/deputy.c: Code executed on the deputy: service remote syscalls (ie. after 
the process has migrated), signals, etc.
</para></listitem>
<listitem><para>

hpc/dfsa.c: Direct File System Access code: the distributed file system 
abstraction layer
</para></listitem>
<listitem><para>

hpc/div.c: the algorithms to do floating point divisions
</para></listitem>
<listitem><para>
hpc/export.c: export symbols needed in other files
</para></listitem>
<listitem><para>

hpc/freemem.c: to keep track of free, avl. memory and to free it if need be. 
hugely taken from the Linux mm/ code.
</para></listitem>
<listitem><para>

hpc/hpcadmin.c: tune openMosix admin values (through /proc/hpc)
</para></listitem>
<listitem><para>

hpc/hpcproc.c: The /proc/hpc code is handled here
</para></listitem>
<listitem><para>

hpc/info.c: The info daemon: sends and receives (multicast) load+mem usage 
stats throughout the cluster
</para></listitem>
<listitem><para>

hpc/init.c: Initialization code: initializes the daemons, etc.
</para></listitem>
<listitem><para>

hpc/kernel.c: most of the "core" code: all the important algorithms, 
decisions, etc. made here.
</para></listitem>
<listitem><para>

hpc/load.c: calculation of local load, etc.
</para></listitem>
<listitem><para>

hpc/mig.c: Code that handles the migration. Code in this file is invoked on 
any migration: deputy->remote, remote->deputy; remote->remote
</para></listitem>
<listitem><para>

hpc/prequest.c: handles the process's requests: signals, more memory, etc.
</para></listitem>
<listitem><para>

hpc/remote.c: Code executed when the process is on the remote: syscalls 
handling on remote, passing control to deputy, etc.
</para></listitem>
<listitem><para>

hpc/rinode.c: fs/ related stuff: used mostly for DFSA
</para></listitem>
<listitem><para>
hpc/service.c: setting up daemons, getting memory, etc.
</para></listitem>
<listitem><para>
hpc/syscalls.c: handles all the remote syscalls here
</para></listitem>
<listitem><para>
hpc/ucache.c: handles the ucache: mostly mm/, fs/ stuff.
</para></listitem>
</itemizedlist>

the other files like auto_syscalls.c, alternate.c are generated at compile 
time.
</para>
</sect1>
</chapter>

