On Sun, Jun 28, 2009 at 11:44 AM, Simon Atkinson<simonatkin...@operamail.com> wrote: > Could somebody please point me to site/article that describes the FreeDOS > boot process. And I'm interested in finding out more about what sys.com > does/how it works, when copying The FreeDOS kernel ..kernel.sys. Does > sys.com change the code in the MBR of a hard disk or only the volume boot > record on, say on the first partition of a disk? >
Other than the documentation in the kernel describing usage there is no other documentation than the source itself that I recall off-hand. The simplist and common case of sys consists of sys copying the source files to destination location, this is functionally equivalent to you doing a (replace X with destination drive) COPY KERNEL.SYS X:\KERNEL.SYS COPY COMMAND.COM X:\COMMAND.COM and then depending on options it will update the 1st sector of the specified partition (note: partition not disk, so the MBR is unchanged by sys, only FDISK and similar change the MBR) with the boot code. The sys program contains several forms of the boot code compiled as binary blobs and writes the one for the file system it detects in use (FAT12/16/32, LBA/CHS, etc) and may patch small portions - it actually reads the current boot sector then overwrites only a portion so existing geometry information (as created by the format process) is not modified. The boot sector may instead (or additionally) be written as file, this allows chain loading FreeDOS from boot managers. Currently, once sys has been run (or a equivalent action that writes the boot code), FreeDOS kernel can be updated/changed with a simple file copy command - there is no requirement it be located at any location (other than in root \ directory) on the disk or have any specific attributes (Hidden/System/Readonly). The kernel generally doesn't care how or who loaded it (there may be some issues with the default drive depending on how loaded, but otherwise it will run even it it can't find any drives, just not very useful) only that the complete KERNEL.SYS file is loaded (by default to address 0x60:0) and jmp'd to. The boot process is identical to every other OS for IBM compatible PCs; the BIOS determines the drive to boot from, loads the 1st sector, passes control to it - which is either the boot code sys put there (such as a floppy) or it does something (like display a menu, read the MBR partition table, etc) and loads the 1st sector of the selected parition (repeat ...) until finally our boot code is loaded. Once the FreeDOS boot sector is loaded, it reads from the default drive (as passed from BIOS or hard coded, usually either 0x80 for 1st hard drive or 0x00 for 1st floppy drive) to determine location on disk of KERNEL.SYS (name is actually stored in boot code so can be any 8.3 name) and loads this file, then jumps to it. The kernel does its init logic and passes control to the shell. Where you get the friendly prompt. The above is from memory, but should be correct. If you have specific questions feel free to ask, I will need to look at the source but can answer any specific questions. The current sys source has not yet been merged into svn trunk but that should occur later this week along with ensuring latest country, share, etc are there. The FreeDOS sys has additional code to set and/or view the configuration options that effect the kernel. The latest release has some additional compile time selected funtionality as well. Jeremy ------------------------------------------------------------------------------ _______________________________________________ Freedos-user mailing list Freedos-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-user