It looks like this hasn't been shared over here yet and there's plenty of time until the deadline (2014/12/31 "at the stroke of midnight MST"), so here goes.
Overview:
To create a boot sector, occupying no more than the first 512 bytes of the disk, to find, load, then execute a specified loader file, while completing specified tasks within this code, as well as following the rules given.
Combuster suggests a bit more detailed but still short definition of the task:
Given a disk with up to four partitions of which exactly one is active and points to a FAT12/16 filesystem, load LOADER.SYS from that filesystem to 0x30000 and jump to it.
Rules and tools.
Discussion @ alt.os.development
Boot Sector Size Competition
Boot Sector Size Competition
Last edited by alexfru on Sun Nov 23, 2014 6:02 pm, edited 1 time in total.
Re: Boot Sector Size Competition
Hi,
a) an MBR, where the partition table describes primary partitions, and where it makes no sense to load anything from any file system whatsoever (e.g. where it should only load the first sector of the active partition and jump to it); or..
b) a boot sector (the first sector of a partition and not the first sector of the disk), where the partition table probably doesn't exist and would describe extended partitions (not primary partitions) if it did exist?
For the latter case; I think the testing should be more realistic. E.g. a dual boot system with some sort of boot manager installed in the MBR (e.g. GRUB, GAG, Plop, etc); with 2 primary partitions that both contain the boot sector being tested and a FAT file system, where the boot sector must only use files from its own partition (e.g. and the boot sector on partition 1 can't accidentally boot the loader on partition 2; regardless of whatever tricks the boot manager does to allow dual boot).
Cheers,
Brendan
Is it supposed to be:alexfru wrote:To create a boot sector, occupying no more than the first 512 bytes of the disk, to find, load, then execute a specified loader file, while completing specified tasks within this code, as well as following the rules given.
a) an MBR, where the partition table describes primary partitions, and where it makes no sense to load anything from any file system whatsoever (e.g. where it should only load the first sector of the active partition and jump to it); or..
b) a boot sector (the first sector of a partition and not the first sector of the disk), where the partition table probably doesn't exist and would describe extended partitions (not primary partitions) if it did exist?
For the latter case; I think the testing should be more realistic. E.g. a dual boot system with some sort of boot manager installed in the MBR (e.g. GRUB, GAG, Plop, etc); with 2 primary partitions that both contain the boot sector being tested and a FAT file system, where the boot sector must only use files from its own partition (e.g. and the boot sector on partition 1 can't accidentally boot the loader on partition 2; regardless of whatever tricks the boot manager does to allow dual boot).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Boot Sector Size Competition
I think you should ask Ben to clarify.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Boot Sector Size Competition
A better summary would be "Given a disk with up to four partitions of which exactly one is active and points to a FAT12/16 filesystem, load LOADER.SYS from that filesystem to 0x30000 and jump to it."
Re: Boot Sector Size Competition
"active" means bootable in this context, doesn't it? so byte 0 of the partition table entry = 0x80?It will be your job to write a boot sector that will check to see which partition is set as the active partition[...]
Re: Boot Sector Size Competition
General problems with "do-far-too-many-things-without-space-doing-them-correctly" boot sectors:
- Obfuscation.
- Hard-wired constants.
- Lack of validity checks.
- Using possibly unsupported instructions.
- Using possibly unsupported BIOS calls.
- Short error messages (if any).
- Hacks like self-modifying code.
- Other hacks.
Re: Boot Sector Size Competition
@Antti: That's not the point of those competitions.
I should be clear that you can't write code which does one thing with as few/small instructions as possible and doesn't miss any of your points at the same time.
It's just a challenge to squeeze a given code in as few bytes as possible.
I don't think that those competitions really favor bad code. Sure the code which results from this competitions will be bad but I don't think anybody will code like this in one of his real projects.
I should be clear that you can't write code which does one thing with as few/small instructions as possible and doesn't miss any of your points at the same time.
It's just a challenge to squeeze a given code in as few bytes as possible.
I don't think that those competitions really favor bad code. Sure the code which results from this competitions will be bad but I don't think anybody will code like this in one of his real projects.