Hi there,
how to call BIOS service via far call i.e. not via interrupt call in real mode?
An example would be very helpful.
thnx in advance,
devel.
Calling BIOS service via far call
Ok, so let me be clear with that. So if processor is in real mode is possible to call BIOS service via far call?
Looking into intel's manual 2A, instruction 'int n' you can read this:
The action of the INT n instruction (including the INTO and INT 3 instructions) is similar to that of a far call made with the CALL instruction. The primary difference is that with the INT n instruction, the EFLAGS register is pushed onto the stack before the return address.
So I think it should be somehow possible or am I wrong?
regards,
devel.
Looking into intel's manual 2A, instruction 'int n' you can read this:
The action of the INT n instruction (including the INTO and INT 3 instructions) is similar to that of a far call made with the CALL instruction. The primary difference is that with the INT n instruction, the EFLAGS register is pushed onto the stack before the return address.
So I think it should be somehow possible or am I wrong?
regards,
devel.
Hi there,
I am trying to call a BIOS vga service in the following way please correct me if I am wrong ...
1. The following structure is defined as representative of a far pointer:
2. I would like to call vga service which should be 0x10's entry in IVT. So I
assume if each entry is 4byte long the service shall be at address (offset in
code segemnt 0x0000) 0x10*4 = 0x40 (ok???). Mentioned vector in my c file
has following values:
3. Then in my assembly code I fill all registers with appropriate values and perform call:
note: this is a gas syntax
After all I should see a character '0' on the screen ... but nothing happens .
FYI, the code is running in real mod, using a qemu soft.
thnx in advance & regards,
devel
I am trying to call a BIOS vga service in the following way please correct me if I am wrong ...
1. The following structure is defined as representative of a far pointer:
Code: Select all
typedef struct {
uint32_t off32; /* lsb */
uint16_t seg16; /* msb */
} bioscall_vector_t;
assume if each entry is 4byte long the service shall be at address (offset in
code segemnt 0x0000) 0x10*4 = 0x40 (ok???). Mentioned vector in my c file
has following values:
Code: Select all
__ATTR(aligned(1)) bioscall_vector_t __bios_vectorcall =
{
.off32 = 0x00000040, // vga service * 4 = offset
.seg16 = 0x0000, // code segment
};
note: this is a gas syntax
Code: Select all
.code16gcc
...
movw $0x0007,%bx /* char's attribute */
movb $0xe,%ah /* bios function: write char */
movb $'0',%al /* char to print */
lcall *__bios_vectorcall /* perform indirect call */
...
FYI, the code is running in real mod, using a qemu soft.
thnx in advance & regards,
devel