Re: The NEW 512 Byte Contest -- Quok Style
Posted: Sat Jan 16, 2010 12:24 pm
If I may answer if quok hasn't done so up to now...
I think many of your questions may be answered by stating: "Do not assume anything except that the medium is not bigger than 8 GB, a file named "OSLOADER" is present, the size of this OSLOADER is below or equal to 128 kB, it has to be loaded somewhere in the first megabyte (though I don't think you have to load it into the ROM ) and OSLOADER is a statically linked ELF32 file." (I think that's what quok means)
So let's go through each of your points.
I'm pretty sure it will have section headers and it may also contain more than two program headers.
Now something about 32 bit arithmetic when using sectors...
quok stated to me that one of his tests will be a 4 GB partition and one will be on an 8 GB medium (I think with the relevant partition as a partition which starts after several GB). Those huge sector numbers won't fit into 16 bit integers. I think you don't get around using 32 bit arithmetic if you want to accomplish all goals, but it's your choice if you want to take a chance.
I think many of your questions may be answered by stating: "Do not assume anything except that the medium is not bigger than 8 GB, a file named "OSLOADER" is present, the size of this OSLOADER is below or equal to 128 kB, it has to be loaded somewhere in the first megabyte (though I don't think you have to load it into the ROM ) and OSLOADER is a statically linked ELF32 file." (I think that's what quok means)
So let's go through each of your points.
Do not assume anything.technik3k wrote:would it be safe to assume that static ELF needed to be supported is like the hello.asm from fasm for linux examples, where the file doesn't have any section headers and only two program headers (one for each code and data segments)?
I'm pretty sure it will have section headers and it may also contain more than two program headers.
You won't know anything about the alignment. But what do you want to say with that relocation?technik3k wrote:What is the linking alignment? Do we expect to relocate data section relative to the code section or they are already properly spaced?
technik3k wrote:Do you want a long jump to e_entry or to the first p_vaddr?
So it's e_entry.quok wrote:Jump to the ELF entry point.
Sorry if it's either my English or my knowledge (or both of them) that's that bad: But what's a paragraph?technik3k wrote:Do you guarantee that is is going to be paragraph aligned?
I think this one is safe to assume.technik3k wrote:BIOS/MBR calls this boot sector code at 0:7C00h with correct boot drive number passed in DL
How you read that sectors is up to you. You might even write a floppy disk driver, a USB driver, a HDD driver and a CDROM/DVD driver but I hardly believe all of those fit into 512 bytes.technik3k wrote:BIOS int 13h CHS calls should be used when Cyl<1024 and LBA calls should be used otherwise
Of course it has to support real floppies. But I can't tell you anything about that reset.technik3k wrote:This boot code needs to support real floppies and therefore needs to do a reset operation.
As far as I know, that BPB will be correct in all points. Hence this sector size will be correct, though I don't know if it's forced to be one of those values.technik3k wrote:FAT BPB has correct sector size (for this media) and it is one of the following values: {512, 1024, 2048, 4096}
128 is also possible (4 GB partition).technik3k wrote:FAT cluster size has one of the following values: { 1, 2, 4, 8, 16, 32, 64 }
I think the number of FAT copies isn't limited. (I'll tell something about those 32 bit arithmetic later on)technik3k wrote:Number of FAT copies is either 1 or 2 and they have reasonable size (i.e. cluster#2 is within 64k sectors from the beginning of the partition, so 32-bit arithmetic is not necessary there)
quok personally stated to me that this is safe to assume though it is wrong according to the specification.technik3k wrote:FileSystemID field is correct and could only be either "FAT12 " or "FAT16 "
Error messages? Who ever said anything about those?technik3k wrote:Finally, since you didn't mention anything about error messages I am going to assume that calling "int 18h" in case of an error is good enough to meet the official rules.
Now something about 32 bit arithmetic when using sectors...
quok stated to me that one of his tests will be a 4 GB partition and one will be on an 8 GB medium (I think with the relevant partition as a partition which starts after several GB). Those huge sector numbers won't fit into 16 bit integers. I think you don't get around using 32 bit arithmetic if you want to accomplish all goals, but it's your choice if you want to take a chance.