English 中文(简体)
Stack size required for bios interrupt call
原标题:

I am working on a small bootloader for learning purposes. Is there any specification/information available about the (free) stack size required for a bios interrupt call?

问题回答

before entering the interrupt handler, all registers are pushed to the stack along with the far return address, sum your registers sizes up and add the space needed to store the return address to get the minimal stack size .

take note that you will need some more space if you are pushing more data into the stack while in the interrupt handler

From http://www.o3one.org/hwdocs/bios_doc/pci_bios_21.pdf ("Calling Conventions" on page 3), it looks like the BIOS call can use up to 1024 bytes of stack space. My googling hasn t turned up any other sources.

I ve noticed that if you are using int 0x13 you should have a stack that is at least 4096 bytes. Modern BIOSes often have an AHCI compatible int 0x13 handler, and since AHCI is quite complicated the BIOS int 0x13 requires a lot of stack space.

In the perfect world the BIOS should have it s own stack, but many BIOSes rely on the stack you provide.

The simple answer is that the stack that the BIOS used to make interrupt calls (including the int 13h to load the boot sector from the usb flash drive) prior to loading the boot sector is sufficient for boot sector use.

The happy answer is that the BIOS interrupts (except for the newer bloated PCI) are designed to execute in minimal space so there is no need to setup a stack in the boot sector.





相关问题
Displaying Graphics in BIOS

Using MASM32 is it possible to display bitmaps stored in a binary file embedded with the executable to the console? Can anyone show me how? Addendum: I m not talking about a full fledge GUI here. ...

How To Print ASCII Extended Characters Using a Const Char*?

I have a function to print characters on the screen that is like this: void print(int colour, int y, int x, const char *string) { volatile char *video=(volatile char*)0xB8000 + y*160 + x*2; ...

Stack size required for bios interrupt call

I am working on a small bootloader for learning purposes. Is there any specification/information available about the (free) stack size required for a bios interrupt call?

Basic OS boot question

I have some kinda basic question to the boot process of a computer and the part where the bootloader calls the OS. So I know that the BIOS copies the first 512 bytes from a bootable drive into memory ...

c# how to determine bios date change

Hello how can i determine with a program (c#) if the Bios Date has Change ? UPDATED i m looking for the machine date, because I want write program that check if some body change that value, figure ...

BIOS build number and Identification number?

I want to get the BIOS Build number and Identification number. I am already using WMI class Win32_Bios dataclass but I it is not returing the value for Build number and Identification number on any of ...

BIOS INT 0x15 Function 0x88 always returns same memory size

I m using BIOS int 0x15 on my Bochs emulator, however this always returns the same memory size (34440) no matter what I have configured: mov ax, 0x88 int 0x15 I know that there are better methods of ...

热门标签