Bootloader threading

Where can I find resources / tutorials on how to implement threads in the x86 architecture loader ... let's say I want to load resources in the background, showing a progress bar.

+3
source share
2 answers

This is a very unusual question ... so let me express my opinion about it ...

  • Loaders are a really limited set of assembler codes, 464 bytes, or rather, 64 bytes for section information and the last two bytes for a magic marker indicating the end of the loader, a total of 512 bytes.
  • Loaders such as Grub can circumvent this limitation by implementing a two-phase loader, the first phase is 512 bytes, as mentioned, then the second phase is loaded, in which additional parameters are executed, etc.
  • As a rule, the bootloader code is in a 16-bit assembly, because the BIOS source code is 16-bit code, and this is what the 386 processor up to the modern processor loads in real mode today.
  • Using a two-phase loader, the first 512 bytes are 16 bits, then the second phase switches the processor to 32-bit mode, adjusting the registers and gate selectors in the process of preparation, and then goes to the input code of the actual program, load - this is taken into account when reading from a specific place on disk or reading a configuration file that contains information about where the download code is stored.
  • 32- - , , - Assembly ( x86).

, C ( , , !)

Grub BIOS , BIOS flashable, EFI (Extensible Firmware Interface ), 32- BIOS - . -, .

, , C/++, ( 32 , , , , .. - ), , , , / .., "", "

+8

- ​​ Linux - . , GRUB UNIX.

, , , ​​ , , .

- , - -, , -, , bullet -, .

, , : D

-1

Source: https://habr.com/ru/post/1726566/


All Articles