Hi everyone,
The build and packaging system is what is next up for discussion.
First of all, the whole thing should obviously be done as a
standard .pm module which builds much as other Perl modules currently
do. CPAN integration is the goal, with everything working correctly
as far as existing standards and methods are concerned (build,
packaging, testing and installation).
The standard for packaging and building used to be the "MakeMaker"
system, but several other build/packaging system are now floating
about in CPAN. It probably doesn't matter too much which one is
used... we'll see when the time comes.
The first step in the build process involves assembling the initial
binary. This consists of several assembly-language (.s) files for
booting (boot.s), mainloop (main.s) and trap handling or native
trampolines (trap.s). These are all placed into an arch/ subdirectory
per-platform (i.e. native/arch/ia32, arch/amd64, arch/mips32, etc
etc). Most modern OSes do something like this. These will be
assembled using a platform-standard native cross assembler or possibly
a Perl-side assembler if one is available.
Next, we have to compile the Perl interpreter using a C cross compiler
or, again, a Perl-side compiler. This code will placed in an arch-
independent subdirectory (i.e. native/perl/ or similar). The output
of this process should NOT require any external linkage.
Finally, we need to package the .pl files which make up the Perl
system into a
system.pm. This will consist of a set of .pl files in a
system/ subtree, such as system/scheduler/*.pl, system/io/*.pl, and
system/driver/*.pl. All of this code should use PerlIO:: and
Pointer:: as its top-level and bottom-level interfaces, respectively.
After all of the build and packaging is done, we move on to the
(possibly optional) creation of the initrd. The basic layout of the
initramfs tree should look something like this:
* fsroot/
** boot/ [ ... system.img, grub.conf, initrd.img, etc ...]
** system/ [... various system interface files a la proc/ in
traditional UNIX]
** config/ [... system config files go here ...]
** data/ [... system data directory ...]
** package/ [... .pm files or other types of system packages ...]
***
init.pm [... initial process a la UNIX ...]
***
system.pm [... The "guts" of PerlOS ...]
Once the initramfs tree has been built, we need to either install it
directly to a disk partition or build an ISO image. Either way, the
first task is to configure a bootloader, probably GRUB. Once the
bootloader has been configured, the next step is to format a partition
or create an ISO image file. After that, the boot image and initrd
image (as well as GRUB configuration files and possibly other types of
config files) are installed into the /boot subdirectory of the rootfs
in question and GRUB is installed into the master boot record.
This should be it. After booting, the initialization and startup
steps described in the system architecture document will be followed
and the system will come up and run.
Jon
**** Configure and build native GRUB
**** Make ISO boot image:
***** GRUB
***** Native system image
***** Initrd image