nasm port
Posted: Tue Mar 29, 2011 3:14 pm
hello everyone,
i have a one really silly question. i want to port nasm to my os, so i can write programs right inside my system.
but i'm not quite sure whitch way should i do it. the most easiest way could be just download nasm for dos with standalone dos protected mode extender (i tried it on fresh dos with nothing else then nasm and extender, i just launched nasm and it worked), switch back to real mode, implement my own dos-like interrupts to the ivt and write some basic routines that would control execution, basic fat12 filesystem and disk reading/writing. After deciding to quit nasm, i would just restore protected mode and continued normal system exection. i thing i want to choose this option, becase these routines (for executing real mode programs under my pmode os and then transfering control back to my os) already exists in my system (i have programmed it for vesa video mode switching purposes). From the other point of view i could just setup unreal mode (thus discarding extender) and implement dos-like interrupts to my existing idt. but again, i'm not sure how to do it. take for example dos int 0x21 - on that idt entry sits my keyboard isr..so this method will obviously require some sort of pic reprograming (again) - and i really do not want to do that. plus - due to the ip 16bit limitation, unexistent pmode idt, different adressing mode etc..., the system will most likely crash.. And take the entire nasm source code (supposing that it is available to the public) and completly rewrite it to acutaly match my system - that is a mission on it's own ...
So, what are my options? what are your advices?
thanks for any reply.
i have a one really silly question. i want to port nasm to my os, so i can write programs right inside my system.
but i'm not quite sure whitch way should i do it. the most easiest way could be just download nasm for dos with standalone dos protected mode extender (i tried it on fresh dos with nothing else then nasm and extender, i just launched nasm and it worked), switch back to real mode, implement my own dos-like interrupts to the ivt and write some basic routines that would control execution, basic fat12 filesystem and disk reading/writing. After deciding to quit nasm, i would just restore protected mode and continued normal system exection. i thing i want to choose this option, becase these routines (for executing real mode programs under my pmode os and then transfering control back to my os) already exists in my system (i have programmed it for vesa video mode switching purposes). From the other point of view i could just setup unreal mode (thus discarding extender) and implement dos-like interrupts to my existing idt. but again, i'm not sure how to do it. take for example dos int 0x21 - on that idt entry sits my keyboard isr..so this method will obviously require some sort of pic reprograming (again) - and i really do not want to do that. plus - due to the ip 16bit limitation, unexistent pmode idt, different adressing mode etc..., the system will most likely crash.. And take the entire nasm source code (supposing that it is available to the public) and completly rewrite it to acutaly match my system - that is a mission on it's own ...
So, what are my options? what are your advices?
thanks for any reply.