Boot Sector Size Competition

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
alexfru
Member
Member
Posts: 1111
Joined: Tue Mar 04, 2014 5:27 am

Boot Sector Size Competition

Post by alexfru »

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
Last edited by alexfru on Sun Nov 23, 2014 6:02 pm, edited 1 time in total.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Boot Sector Size Competition

Post by Brendan »

Hi,
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.
Is it supposed to be:

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.
alexfru
Member
Member
Posts: 1111
Joined: Tue Mar 04, 2014 5:27 am

Re: Boot Sector Size Competition

Post by alexfru »

I think you should ask Ben to clarify.
User avatar
Combuster
Member
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

Post by Combuster »

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."
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Cjreek
Member
Member
Posts: 70
Joined: Thu May 28, 2009 2:41 pm
Location: Germany

Re: Boot Sector Size Competition

Post by Cjreek »

It will be your job to write a boot sector that will check to see which partition is set as the active partition[...]
"active" means bootable in this context, doesn't it? so byte 0 of the partition table entry = 0x80?
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: Boot Sector Size Competition

Post by Antti »

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.
This competition could favor bad code. Anyway, good luck.
Cjreek
Member
Member
Posts: 70
Joined: Thu May 28, 2009 2:41 pm
Location: Germany

Re: Boot Sector Size Competition

Post by Cjreek »

@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.
Post Reply