bzt wrote:
Oh yes, there's still place for lots of optimizations
![Smile :-)](./images/smilies/icon_smile.gif)
Use 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).
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:
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.
Maybe some day I will fix those things, but not now
![Smile :)](./images/smilies/icon_smile.gif)
, as I would have to rewrite almost all of the code. And about str_cmp, you are right, that check is completely useless, cannot imagine what I was thinking of when I wrote it. Also, I learnt about cmpsb, and that made it quite smaller.
At the end I managed to add the help feature, just added it to have more features, as I cannot think of a great reason to use it. I will probably stop improving it for now and continue with my OS. Thanks to everyone who helped me.
Edit: I also made another release on GitHub if anyone wants to try it:
https://github.com/segfaultdev/flat_boot.