flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Writing Software Interrupts

Author
Thread Post new topic Reply to topic
log(21



Joined: 09 Jun 2006
Posts: 6
log(21 16 Sep 2006, 19:39
How can I write my own software interrupt? (I am working on writing a small OS, and I would like to do something similar to what DOS does with INT 21h.

For example, how could I get this code:

;Some code
mov ax, bx
mov cx, dx

...To be run every time INT 21h was called?

Thanks.
Post 16 Sep 2006, 19:39
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 16 Sep 2006, 20:18
Check http://board.flatassembler.net/topic.php?p=42174#42174 (I don't know why I'm using CLI when installing the new handler, that's makes sense only when you modify a hardware interrupt vector).
Post 16 Sep 2006, 20:18
View user's profile Send private message Reply with quote
Niels



Joined: 17 Sep 2006
Posts: 255
Niels 17 Sep 2006, 09:50
If you are writing an OS, even a small one, you should be familiar with the INTEL documents, the system programming guide in specific. There you will come across an instruction lidt, this can load your new interrupt-table-scheme. This table should content the specific address of all present interrupts. Other than that, be more specific please, or just ask write my code for me.
Post 17 Sep 2006, 09:50
View user's profile Send private message Reply with quote
Niels



Joined: 17 Sep 2006
Posts: 255
Niels 17 Sep 2006, 10:07
I don't know if the (interrupt)tutorials are correct...
http://www.osdever.net/tutorials.php?cat=0&sort=1
Post 17 Sep 2006, 10:07
View user's profile Send private message Reply with quote
Niels



Joined: 17 Sep 2006
Posts: 255
Niels 17 Sep 2006, 10:17
In protected mode one must first remap the PIC cause INTEL uses the first 32(0-31) for internal procedures.
Post 17 Sep 2006, 10:17
View user's profile Send private message Reply with quote
Niels



Joined: 17 Sep 2006
Posts: 255
Niels 17 Sep 2006, 11:32
Post 17 Sep 2006, 11:32
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 17 Sep 2006, 14:28
See MiniDOS, a 2k Dos clone, With fully commented fasm code.
http://board.flatassembler.net/topic.php?t=5275&start=0

PS: Iet me know if your talking pmode int's.
Post 17 Sep 2006, 14:28
View user's profile Send private message Reply with quote
Niels



Joined: 17 Sep 2006
Posts: 255
Niels 17 Sep 2006, 15:10
@Dex4u: I did made that assumption, cause int 21h is already there in rm Smile
Post 17 Sep 2006, 15:10
View user's profile Send private message Reply with quote
Niels



Joined: 17 Sep 2006
Posts: 255
Niels 22 Sep 2006, 14:18
Hello log(21,

It still confuses me; Do you want code that does exactly what INT 0x21 does, or you don't know how interrupts can be hailed by the OS.

That's why I asked to specify. Smile
Post 22 Sep 2006, 14:18
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.