Changes

247 bytes removed ,  00:01, 5 July 2021
m
Merged in a later paragraph
Line 4: Line 4:  
'''boot2''' is the [[Wii]]'s third-stage bootloader. It is responsible for loading the [[System Menu]] [[TMD]] and loading the appropriate [[IOS]] under normal circumstances, although it can also load [[MIOS]] if it detects the lowered clock speed set by [[BC]] (if [[IOS/Syscalls|syscall 55]] returns 162).
 
'''boot2''' is the [[Wii]]'s third-stage bootloader. It is responsible for loading the [[System Menu]] [[TMD]] and loading the appropriate [[IOS]] under normal circumstances, although it can also load [[MIOS]] if it detects the lowered clock speed set by [[BC]] (if [[IOS/Syscalls|syscall 55]] returns 162).
   −
Like IOS, boot2 has multiple modules. In this way, it can be thought of as an IOS installed to a special part of the NAND. However, all modules are contained within a single binary, much like IOSes before [[IOS28]]. Boot2 has a kernel with IOSC functionality, an ES module, and an FS module.
+
Like IOS, boot2 has multiple modules. In this way, it can be thought of as an IOS installed to a special part of the NAND. However, all modules are contained within a single binary, much like IOSes before [[IOS28]]. Boot2 has a kernel with IOSC functionality, an ES module, and an FS module. Unlike IOS, get_kernel_flavor writes 0 to the first argument instead of 3, which distinguishes it from IOS.
    
boot2 is also launched by MIOS when the power button is pressed; the System Menu is initialized in this case, and [[Memory Map|0x80003164]] <!-- read as c0003164 by the system menu; written as 00003164 by boot2 --> is set to 1 if the SRSTB_CPU bit is set in [[Hardware/Hollywood_Registers#HW_RESETS|HW_RESETS]]; the System Menu checks 0x80003164 and shuts down if it is enabled and [[:/title/00000001/00000002/data/state.dat|state.dat]] is set appropriately, with the message "Shutdown system from GC!".
 
boot2 is also launched by MIOS when the power button is pressed; the System Menu is initialized in this case, and [[Memory Map|0x80003164]] <!-- read as c0003164 by the system menu; written as 00003164 by boot2 --> is set to 1 if the SRSTB_CPU bit is set in [[Hardware/Hollywood_Registers#HW_RESETS|HW_RESETS]]; the System Menu checks 0x80003164 and shuts down if it is enabled and [[:/title/00000001/00000002/data/state.dat|state.dat]] is set appropriately, with the message "Shutdown system from GC!".
  −
boot2 is built from the same code as a regular IOSes, but has a [[IOS/Syscalls|kernel flavor]] (syscall 47) of 0 instead of 3; boot2's ES module includes all of the [[:/dev/es|normal ES functionality]] but it goes unused due to this kernel flavor value.  Regular IOSes also have the same check for a flavor less than 3, but the bootmii path goes unused.
      
There are two copies of boot2 housed in [[Hardware/NAND|NAND]] blocks 1-7 in case of failure, loaded by [[boot1]].
 
There are two copies of boot2 housed in [[Hardware/NAND|NAND]] blocks 1-7 in case of failure, loaded by [[boot1]].
5,579

edits