[SeaBIOS] How to add user-defined interrupt to SeaBIOS?

Andreas H. kosi2801 at gmail.com
Wed Dec 8 18:00:04 CET 2010


as part of a small exercise project for university I have to add a
custom software interrupt to the bios code which is then used by some
later booting stages. I already had a close look to the sourcefiles
and although I don't understand many of the stuff (I can read and
understand the individual parts but don't get the real big picture) I
have some anchorpoints which I think are necessary to complete my
work. I'd really appreciate if someone had a quick look on those
points and just confirmed or denied (maybe with other hints) them :)

1.) the IVT is set up in "post.c", to add my interrupt, I have to add
a line "SET_IVT(0x60, FUNC16(entry_60));" to init_ivt()
2.) romlayout.S contains the declarations for the IRQ handler, I have
to add a "DECL_IRQ_ENTRY_ARG 60" to the section "irqentryarg:"
3.) in my own .c-file I have to add a function "void VISIBLE16
handle_60(struct bregs *regs)" which receives the IRQ
4.) in this custom function I receive the set parameters from the
caller in the register-structure and also set my return values in this
5.) usable registers for arguments/return values are AX, BX, CX, DX,
DS, etc. I'd need DS:DX (analog to DOS) for passing a memory address
and CS:CX for a buffer size.
6.) the IRQ handler has to end with "set_success(regs);" or
"set_invalid(regs);" to return success/failure in CF (or should I use
AX for this and just call set_success?)

One last question: I chose IRQ 60 because it's stated as "user
defined" in "post.c". Should I use another one to not run into issues
with later stages of OS booting or will it just get overwritten at
some point?

Thanks in advance,

More information about the SeaBIOS mailing list