Open In App

How much Stack size required for BIOS interrupt call?

Stack size required for bios interrupt calls?

1)  For No interrupts generated in task

Formula For calculating Stack size required for bios no interrupt call

Task stack size = size used by user + argument size of the service-call + 6 (bytes)



2)  For Interrupts generated in task

The formula for calculating Stack size required for bios interrupt call

Task stack size = size used by user + service-call argument size + 6 + 20 (bytes)



Example:

Suppose If we are given a task “Task1”, function GFG1 (using 12 bytes of the stack) makes a gfg_geek1 service call, and function GFG2 (using 20 bytes of the stack) makes a gfg_geek2 service call.

Since this is a  interrupts generated task we will use Formula 2 for calculating the size.

Now we will compare the pattern of gfg_geek1 with the pattern of gfg_geek2 now the pattern that uses the most stack is pattern gfg_geek1, at 42 bytes. The size that needs to be specified in the system for the file will be 42 minus 6 bytes, which equals 36 bytes. 

Article Tags :