It was originally made for my own OS, flat_core, but I decided to make it public for everyone to use on their OSes. I would also love to see some feedback about it.
Some screenshots:


How could I have forgotten it!bzt wrote:Your repo does not contain source nor a binary, so it is quite difficult to try it out.
You are right, that is an old version(that one was made in C and not in NASM, I later switched to the latter as code was too big).bzt wrote:The flat-boot.c in your other repo does not have a menu nor a config parser, so I'm guessing this supposed to be a different flat-boot.
Cool, thanks!segfaultdev wrote:How could I have forgotten it!Now it is fixed.
And without even using REP STOSW for your mem_set function? You just might have room for more features!segfaultdev wrote:fitting on just 512 bytes.
I will find more tricks like the one you mentioned to make it even smaller, and then I could be able to add more features like to continue booting with the next bootable drive or more customization, thanks.Octocontrabass wrote:And without even using REP STOSW for your mem_set function? You just might have room for more features!
...and that is why I did not do it myselfOctocontrabass wrote:Unfortunately, FAT32 and exFAT reserve some space in the boot sector, so you would have even less room for code. You would probably have to split it across two sectors, and then it's not as much fun because you have more than 512 bytes to work with.
Octocontrabass wrote:You might want to add a CLD instruction somewhere.
Well, I tried to make both changes by making it smaller to fit them, and I properly implemented the menu which shows the help.txt file on the screen, but now the problem is that my bootloader is 59 bytes too big, and I do not know how to make it smaller(I do not want to start using dirty tricks like writing into the null GDT entry, but it still would not fit). Is it even possible to do it?segfaultdev wrote:I may also try to change the reboot key to F2 and add a help menu loaded from a help.txt file to F1, although it seems difficult having only 2 bytes left.
Oh yes, there's still place for lots of optimizationssegfaultdev wrote:Well, I tried to make both changes by making it smaller to fit them, and I properly implemented the menu which shows the help.txt file on the screen, but now the problem is that my bootloader is 59 bytes too big, and I do not know how to make it smaller(I do not want to start using dirty tricks like writing into the null GDT entry, but it still would not fit). Is it even possible to do it?
[The extension s has been deactivated and can no longer be displayed.]
Thanks a lot for the help, I did not know that you could use the null GDT entry. I managed to fit it by making both the help function and some more functions smaller, which also made me learn about INT 10h AH=13h.bzt wrote:Oh yes, there's still place for lots of optimizationsUse the null GDT entry freely, that's common practice to put the GDT value there.
I've inlined some functions and rearranged things (which rendered some set register instructions unnecessary). With these, I've saved you 30 bytes (still 29 to go).
Maybe some day I will fix those things, but not nowbzt wrote:Notes: don't use pusha/popa that much in your internal functions. Instead try to figure out the registers and rely on their values. Your str_cmp could be improved too, not sure why you check 0xA after str_cmd_end label. Try to minimize direct memory addresses in instructions, as they need the most space.