×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

OS Development: Interrupt Hooking and Stack placement

OS Development: Interrupt Hooking and Stack placement

OS Development: Interrupt Hooking and Stack placement

(OP)
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.

RE: OS Development: Interrupt Hooking and Stack placement

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?

RE: OS Development: Interrupt Hooking and Stack placement

Hi,Epidemi,
  Can you study linux which have all the stuff:bootloader,FS,etc!



Regards!

RE: OS Development: Interrupt Hooking and Stack placement

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

RE: OS Development: Interrupt Hooking and Stack placement

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.



A plain black box
"Suffice it to say that adding disk drives and a disk operating system to a personal microcomputer is guaranteed to increase its power dramatically."
CP/M and the Personal Computer

RE: OS Development: Interrupt Hooking and Stack placement

Thanks Alt255

You're so right :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close