Sunday, November 17, 2024
Google search engine
HomeData Modelling & AIHow much Stack size required for BIOS interrupt call?

How much Stack size required for BIOS interrupt call?

  • Stack: It is a linear data structure that follows the LIFO( Last In First Out ) order for performing the operations. 
  • BIOS: It provides a set of instructions and is responsible for booting the computer. The BIOS performs all the tests needed at startup time.

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.

  • Pattern of gfg_geek1 = size used by user (for function A) + service-call argument size (gfg_geek1) + 6 + 20
    = 124620
    = 42 bytes
  • Pattern of gfg_geek2 = size used by user (for function B) + service-call argument size (gfg_geek2) + 6 + 20
    = 200620
    = 26 bytes

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. 

Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

Commit to GfG’s Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.

Last Updated :
14 Sep, 2022
Like Article
Save Article


Previous

<!–

8 Min Read | Java

–>


Next


<!–

8 Min Read | Java

–>

Share your thoughts in the comments

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments