Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OS Development: Interrupt Hooking and Stack placement 1

Status
Not open for further replies.

CesiumFrog

Programmer
Sep 10, 2000
2
0
0
AU
Hey,

I'm trying to write my own "operating system" (just a learning exercise) in assembly. So far I have a bootstrap which prints a message, loads the next sector at 60:0 h, then jumps there. Then my "kernel" prints a message and hangs, for want of something better to do. Thanks to everyone here for all the tips I've gleamed from this forum.

My next problem is hooking an interrupt. It hasn't worked yet. I'd like to use an arbitrary int to store various functions (the way DOS uses int 21), and also intend to hook the timer interrupt. Could someone give an example piece of code, doing either of these? (without using DOS functions)

Finally, where might you recommend I place my stack? Ralf Brown's Memory.lst seems to be of no help.

Thankyou. [sig][/sig]
 
Hi ya folks!

I might be a bit late on this one, but I just joined tek-tips. I'm currently writing an OS myself, and I must say it's pretty cool to do.
I already have a bootloader and a partially implemented file system I designed (FAT-like, though).

But about your question:
It's easy to write to the screen in text mode.
Just do a
mov ah, 0e
mov al, '.'
int 10h
where you put the character to print in al.
so just do a loop like this to print a string:
mov si, offset msg
mov ah, 0e
@lp:
loadsb
cmp al, 0
je done
int 10h
jmp @lp
done:

Reading the disk can be done with function ax=201 with the DISK int# (g, what was that?:) and writing with ax=301
see Raphs interrupt list for more info

Anyway, good luck!

------------------------------
Who needs Windows anyways? :)
[sig][/sig]
 
Hi,Epidemi,
Can you study linux which have all the stuff:bootloader,FS,etc!



Regards! [sig][/sig]
 
Hi Zallen

of course I could do that but then I would be creating another Linux/BSD clone. I want to create my _own_ OS. So maybe I'll have a look at some pieces of code, but I'll try to do the majority myself.

Thanks or the advice anyways.
Best regards,

Epidemi [sig][/sig]
 
Some advice my father gave me: "Don't make the same mistakes your father made."

Looking forward to a new OS. Maybe this is Eden.

[sig]<p> <br><a href=mailto: > </a><br><a href= plain black box</a><br>"Suffice it to say that adding disk drives and a disk operating system to a personal microcomputer is guaranteed to increase its power dramatically."<br>
<u><b>CP/M and the Personal Computer</u></b>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top