Page 1 of 3
OS CodeWars
Posted: Thu Feb 26, 2004 7:03 pm
by mr. xsism
Re:OS CodeWars
Posted: Fri Feb 27, 2004 3:07 am
by bubach
how r u supposed to fit all that in one bootsector? i guess that we are allowed to use a second stage loader?
Re:OS CodeWars
Posted: Fri Feb 27, 2004 3:45 am
by srg
I must admit my first impression was "you don't want a lot!" ;D
srg
Re:OS CodeWars
Posted: Fri Feb 27, 2004 10:32 am
by mr. xsism
it's all very simple. Just meet the goal, do it well, code nicely, and be judged. This challenge is gonna be very simple to a lot of people. But don't worry, they'll get harder!
thanks for the feedback :]
Re:OS CodeWars
Posted: Fri Feb 27, 2004 12:41 pm
by Neo
my present bootloader meets these requirements where can i submit it. its 2 stage btw
Re:OS CodeWars
Posted: Fri Feb 27, 2004 7:47 pm
by Curufir
mr. xsism wrote:
Just meet the goal, do it well, code nicely, and be judged.
You can't code it
nicely in 512 bytes, and with the FAT12/bootsector requirement you've already lost something like 63 bytes anyhow. Sure it can be done, but fitting that much into that little space effectively makes it a test of people's real mode assembly programming, not their OS skills.
Re:OS CodeWars
Posted: Sat Feb 28, 2004 1:38 am
by mr. xsism
maybe we should limit it to 1 stage. I did it in 512bytes. Curifir, bootsectors are part of OS dev, come on dude. You can't ahve an OS without a bootsector.
Like i said, the challenges will get harder. I know most of the people that are readign this can already print text, get keyboard input, etc. This is ment for fun and teaching noobs.
I would appreciate your HUMBLE support. Humility is a great quality when it comes to teaching.
Re:OS CodeWars
Posted: Sat Feb 28, 2004 5:20 am
by Schol-R-LEA
I would see few problems with it, if the rules were relaxed so as to permit you to put most of the work, i.e. a20 gate, p-mode, etc. into the second stage, either a hidden file similar to the MS-DOS IO.SYS, or in the kernel.bin file itself. The problem lies in trying to fit all of that into the 474 bytes available in the FAT12 boot sector (512 - (2 byte bootsig + 3 byte jump and noop + 8 byte OEM ID + 25 byte FAT12 BPB); remember, a FAT12 BPB is a little less than half the size of a FAT16 BPB). While it may be possible, it would require some very butch assembly coding.
EDIT: corrected size of available space. I was half asleep when I wrote that, OK?
Re:OS CodeWars
Posted: Sat Feb 28, 2004 6:30 am
by Tim
mr. xsism wrote:Curifir, bootsectors are part of OS dev, come on dude. You can't ahve an OS without a bootsector.
You can't have an OS without the BIOS. Is that part of OS development? No, it's part of the infrastructure required to get the OS booted. As far as the kernel is concerned, the BIOS's sole job is to get the hardware initialised far enough that it can be loaded from disk and run.
Is the boot sector part of OS development? No, it's part of the infrastructure required to get the OS booted. As far at the kernel is concerned, the boot sector's sole job is to use the BIOS to get the kernel loaded from disk and run.
IMO, boot sectors are entirely uninteresting -- there's only one goal (get stuff loaded) and only one way to do it (load from disk, enter protected mode, JMP).
Re:OS CodeWars
Posted: Sat Feb 28, 2004 7:33 am
by nullify
I hope this first challenge isn't suggestive of what forthcoming challenges will be like (not in terms of "easyness" but in terms of the policy/mechanism balance). Most challenges should be held on modules where there is at least _some_ policy decisions to be made, because this is where the creativity comes in when designing your solution. Mechanism is grunt work that is for the most part the same in various implementations. Bootloaders are an area almost completely dominated by the mechanism department.
Re:OS CodeWars
Posted: Sat Feb 28, 2004 9:34 am
by mr. xsism
so instead you guys would rather just code strictly OS modules dealing with the kernel?
hey tim, maybe we will have a BIOS challenge
Re:OS CodeWars
Posted: Sat Feb 28, 2004 9:43 am
by Tim
mr. xsism wrote:
so instead you guys would rather just code strictly OS modules dealing with the kernel?
Well, that's what OS development means to me. nullify hit the nail on the head: it's nicer to have some element of design/policy as well as implementation/mechanism. If it was purely mechanism, then this would be a contest to see who could read the Intel manuals best.
Having said that, I've been hacking on a boot sector today, but with a difference. It enables protected mode and paging first of all,
then tries to load stuff off disk.
hey tim, maybe we will have a BIOS challenge
Sounds fun!
Hmm, maybe not quite yet.
Re:OS CodeWars
Posted: Sat Feb 28, 2004 9:55 am
by Candy
Tim Robinson wrote:
Having said that, I've been hacking on a boot sector today, but with a difference. It enables protected mode and paging first of all,
then tries to load stuff off disk.
Sounds incredibly cramped, but a really nice thing if you can pull it off. Keep us informed
Re:OS CodeWars
Posted: Sat Feb 28, 2004 10:09 am
by Tim
I'm going down the route of putting floppy drive code in the page fault handler, then jumping to 0010_0200 to execute the code stored just after the boot sector. I hope I can fit it all in 512 bytes!
Re:OS CodeWars
Posted: Sat Feb 28, 2004 12:27 pm
by Neo
John Fines bootf02 does this IIRC. so wheres the challenge in doing this?