I wanted to answer the question :
How the cpu get suddenly a program inside his ram ?
I wanted to implement a kind of bios inside the cpu, the goal of this bios is to found Floppy Drives (or other drives) and boot from it.
So for this we need a solid partionning sytem of the floppy.
I wanted to make something similar to the master boot record of a hard drive (my expermentations are visibles here : https://github.com/Zardoz89/dcpu_vm ). But the sector of a floppy in 0x10c "official specs" size 1024 bytes (512 word). So the systems are completely imcompatibles ! (real floppy have sectors which size 512 bytes !)
Then i think we need to completely re-invent the partionning sytem...
It must provide :
1 partition that contains the boot program (if the floppy have one)
1 partition that contains the table of the files
1 partition that contains the datas of the files
The sector 0 will contains all informations abouts the partitions
To be simple : 1 cluster = 1 sector = 512 words = 1024 bytes
Boot partition :
The sectors of this partition are copied into the address 0x0 (for maximum compatibility) by the bios at startup
Table partition :
I'm thinking about something as simple as possible each sector of this partition represent a folder, a folder or a file are described by 32 words (64bytes) :
- Code: Select all
| 0x0 - 0x28 : File/folder name null terminated | 0x29 real size of the file in words | 0x30 first sector of the file | 0x31 last sector of the file|
if 0x0 = 0 then the file/folder is not allocated (the space is free)
0x29 = 0 if it's a folder
If its a folder 0x30 = 0x31
A folder sector will contains maximum : 16 files or folders
The first item will be the parent folder, so the real maximum will be 15 files or folders
Data partition :
Will just contains the datas described by the table partition
I have also an other idea to fix the size of a file (it's much simple for the programmer), so a file will always size X sectors on the disc whatever that's real size
But the problem is : which size given to the file ? -> make 3 types of files : big X sectors, medium, Y sectors, Z sectors but at this point we return to the original problem...
I have never created partion system before so may be i'm wrong so i wait your remarks !