I've updated the Gist, and here's the hexdump:
Code: Select all
EA 10 7C 00 00 B0 24 31 DB B4 0E CD 10 F4 EB FD 31 DB 8E D3 BC 00 7C 8E DB 8E C3 9C 58 80 F4 30 50 9D 9C 59 30 EC 84 E4 75 DB FC 88 16 00 05 B0 03 CD 10 B5 26 B4 01 CD 10 31 F6 BD 00 FE 31 FF BB 41 00 E8 54 01 81 ED 00 02 4B 75 F6 80 3E 00 7E 90 75 09 89 EB 81 C3 00 02 E9 AB 00 66 60 06 B8 00 B8 8E C0 31 FF B9 00 02 66 B8 30 0B 30 0F F3 66 AB 89 EB 01 F5 95 C1 E6 02 26 66 C7 04 30 04 30 04 BE 06 0F B9 02 00 E8 4C 01 26 88 14 26 88 74 FE 83 EE 04 C1 E8 08 E2 EE 31 F6 8A 07 E8 36 01 26 88 34 26 88 54 02 43 83 C6 04 81 FE 00 08 72 EA 07 66 61 89 EB 01 F3 30 E4 CD 16 80 FC 4B 75 04 4E E9 9C 00 80 FC 4D 75 04 46 E9 93 00 80 FC 40 75 07 89 1E 01 05 E9 87 00 80 FC 42 75 02 EB 05 80 FC 41 75 1B 8B 3E 01 05 8A 0D 88 0F 80 FC 42 74 07 46 FF 06 01 05 EB 67 4E FF 0E 01 05 EB 60 80 FC 3B 75 08 55 FF D3 5D 31 F6 EB 53 80 FC 3E 75 10 31 FF 47 89 EB C1 EB 09 83 EB 3E E8 77 00 EB 3E 80 FC 3F 75 17 55 BD 00 FE 31 FF 47 BB 41 00 E8 63 00 81 ED 00 02 4B 75 F6 5D EB 22 80 FC 50 75 0C 81 FD 00 FE 74 17 81 C5 00 02 EB 11 80 FC 48 75 13 81 FD 00 7C 74 06 81 ED 00 02 EB 00 81 E6 FF 01 E9 F3 FE 66 C1 E0 10 CD 16 86 E0 66 C1 E8 08 3C 1B 74 E9 B9 02 00 2C 30 3C 09 76 08 2C 07 3C 0F 76 02 2C 20 86 C4 E2 EE C0 E0 04 C1 E8 04 88 07 46 EB C9 66 60 93 31 F6 89 EB BE 03 00 31 D2 B9 12 00 F7 F1 88 D1 FE C1 88 C6 80 E6 01 D1 E8 88 C5 8A 16 00 05 C1 E7 08 F8 B8 01 02 01 F8 CD 13 73 0C 30 E4 CD 13 4E 75 EF B0 40 E9 32 FE 66 61 C3 0F B6 D0 C1 E2 04 C0 EA 04 B0 02 80 FA 09 7F 05 80 C2 30 EB 03 80 C2 37 86 F2 FE C8 75 ED C3 00 00 00 00 00 00 00 55 AA
- The code now loads the first few sectors from the floppy at 0x7C00 to 0xFFFF. F5 writes these all back to disk. F4 writes the current sector to disk. There is no inter-segment handling, anymore.
- F1 calls the current index. It does a simple call, so you can now return with 0xC3 (ret). Also, you don't need to save/restore BP/SI anymore.
- If the byte at 0x7E00 is 0x90 (nop), then it automatically calls it. Note that the procedure followed here is the same described in the above point.
- F6 behaves like the previous retain (copy). F8 behaves like the previous paste, which I now call move. F7 is paste, since it INCREMENTS both the pointers, as opposed to F8.
For floppies, I suppose you could simply switch them, yes.DavidCooper wrote:There's also the issue of how to make backups. Ideally you should be able to do so without using another operating system, so if you're using floppy disks you should simply be able to switch disks and press w to create a perfect copy. BwtSecOS also fails at the moment in that regard as it would save everything except the bootsector, so new code would need to be written by the user to save the bootsector (though that would be a simple matter of creating a block of seven bytes to define what's to be saved and where it's to be saved to before calling the existing save routine in the bootsector.)
I don't think anyone has a partition on a typical flash drive. You could, however, save it in different LBAs inside the flash drive via changing one value in the EventLoop.Write/EvenLoop.Save functions. I'll add that to the manual, obviously. Also, note that you can probably create a more "terse" backup system in the second sector yourself!DavidCooper wrote:If working from flash drives things become more problematic as some BIOSes may only support one flash drive such that it's the only place you can save the OS from within the OS. This is why being able to save through LBA to a partition is important: you would be able to edit the LBA start location before pressing w to save a copy to a new location in the partition, so if the main version got into an unrecoverable mess, the bootsector could still edit itself and change the start LBA, and then it could jump to its own first byte to load in an undamaged copy from another location in the partition. This would allow you to store thousands of copies on the same flash drive as you develop your OS and to backtrack to a stable version whenever a problem turns up.
Regards,
Shikhin