operating system - What does BIOS do after loading Global/Interrupt Descriptor Table Register in JOS? -


i have analyzed first codes when bios starts executing until loading global/interrupt descriptor table register. bios i'm talking 1 mits course "operating systems engineering". have difficulities understanding how bios after that.

[f000:fff0]    0xffff0: ljmp   $0xf000,$0xe05b #when bios starts executing, jump address fe05bh continue execute [f000:e05b]    0xfe05b: cmpl   $0x0,%cs:0x6574 [f000:e062]    0xfe062: jne    0xfd2b6 [f000:e066]    0xfe066: xor    %ax,%ax [f000:e068]    0xfe068: mov    %ax,%ss #set %ss 0 [f000:e06a]    0xfe06a: mov    $0x7000,%esp [f000:e070]    0xfe070: mov    $0xf3c24,%edx [f000:e076]    0xfe076: jmp    0xfd124 [f000:d124]    0xfd124: mov    %eax,%ecx [f000:d127]    0xfd127: cli #turn off interrupt [f000:d128]    0xfd128: cld  # set df flag 0, when  df=0, si = si + 1 , di = di + 1 [f000:d129]    0xfd129: mov    $0x8f,%eax [f000:d12f]    0xfd12f: out    %al,$0x70 [f000:d131]    0xfd131: in     $0x71,%al #close nmi through 70h i/o port, selecting cmos 0xf register, , assigining 0xf register's value %al register [f000:d133]    0xfd133: in     $0x92,%al [f000:d135]    0xfd135: or     $0x2,%al [f000:d137]    0xfd137: out    %al,$0x92 #enable a20 address line [f000:d139]    0xfd139: lidtw  %cs:0x6690 [f000:d13f]    0xfd13f: lgdtw  %cs:0x6650 #loading global/interrupt descriptor table register [f000:d145]    0xfd145: mov    %cr0,%eax [f000:d148]    0xfd148: or     $0x1,%eax [f000:d14c]    0xfd14c: mov    %eax,%cr0 #set cr0 pe=1. when pe=1 cpu in protected mode [f000:d14f]    0xfd14f: ljmpl  $0x8,$0xfd157  target architecture assumed i386  => 0xfd157:    mov    $0x10,%eax  => 0xfd15c:    mov    %eax,%ds  => 0xfd15e:    mov    %eax,%es  => 0xfd160:    mov    %eax,%ss  => 0xfd162:    mov    %eax,%fs  => 0xfd164:    mov    %eax,%gs  #after loading gdtr, it's necessary reload segment register  ..... 

after these codes, don't know how bios executes search bootable device such floppy, hard drive, or cd-rom. eventually, when finds bootable disk, bios reads boot loader disk , transfers control it

super late response having same question , found answer in seabios source code

the page linked source code vector mapped reset vector. if want parse through 40 kilobytes of bios code in gdb, feel free grab scratch paper , start mapping out stack layout , bios code layout. spent few hours doing before deciding read source code instead; it's healthier read source code.

edit: check out this section on wikipedia page bios on option roms, gives better info on option roms wikipedia page option roms. took forever figure out.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -