Results 1 to 6 of 6
Hi everyone,
I am trying to learn OS fundamental from a programmers perspective and currently studying on real mode programming.I have experience with protected mode but never actually did something ...
- 01-29-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 9
Real Mode Programming
Hi everyone,
I am trying to learn OS fundamental from a programmers perspective and currently studying on real mode programming.I have experience with protected mode but never actually did something in real mode.
I searched around to see if I can grab some tutorials or etc but nothing significant especially for C (most of them are for assembly)
My question is;
I wrote a program in C for protected mode and it works as expected.It does basic disk I/O read() and write(), in real mode I know these functions are available through "int 13" but I have no clue where to start in C.
Can I switch to or simulate real mode while linux is running ? Is there such a feature?
Also I would like to know how to port protected mode code to real mode so that ported code will only use bios interrupts.
Any ideas and help are welcomed!
Thank you
- 01-29-2010 #2
This may interest you...Then again it my not
bcc(1): Bruce's C compiler - Linux man page
Check the 'see also' at the bottom of the man page
Plus this one
SourceForge.net: Linux Real Mode Interface - Project Web Hosting - Open Source SoftwareMake mine Arch Linux
- 01-29-2010 #3Just Joined!
- Join Date
- Jan 2010
- Posts
- 9
I know that I need to swtich to vm to call real mode interrupts from protected, but coudln't find a resource that explains the process of this.
I mean I can only do bios interrupts from real mode but how about porting a protected mode code to real thats where I am stuck.
Seabios seems really interesting though, I will check it out.
- 01-29-2010 #4
- 01-29-2010 #5
You're probably better off working in DOS.
Install dosemu. It is a way to run a DOS session under
Linux. You can then run a real mode C compiler like PCC
as well as any assembler you choose to write assembly code.
With dosemu, you can run your own copy of DOS, or the default
install of freedos
- 01-31-2010 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
The dosemu package might work for you, or you can run DOS in a virtual machine and learn all about real-mode programming and bios interrupt handling all you want without jeapordizing your system. Do run it on hardware that support hardware virtualization however, to better protect your host OS.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
