Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding os bootloading - assembly

I am trying to go more indepth os understanding. So, the linux boot has to deal with an assembly file. I know about mov, push, pop, but here I am quite lost with this :

.globl  __start
    .ent    __start
__start:
    br  $29,2f
2:  ldgp    $29,0($29)
    jsr $26,start_kernel
    call_pal PAL_halt
    .end __start

switch_to_osf_pal:
    subq    $30,128,$30
...

Am I correct if I say that __start is a label ? So will it be called as soon as it is called in an other peace of code ? I tried to google around to understand the ldgp, or call_pal symbols but I found nothing. At last, I found in c files that switch_to_osf_pal is called in this way switch_to_osf_pal(2, pcb_va, pcb_pa, VPTB); is this functions taking this params call the assembly function ?

Sorry if there is a to much questions, but I didn't find any clear doc

like image 814
epsilones Avatar asked Oct 22 '22 13:10

epsilones


1 Answers

__start is a label.

ldgp means load global pointer in Alpha assembly.

call_palmeans call privileged architecture library. It is an unconditional jump to an exception handler.

More information in Assembly Programmer's Guide

like image 145
mouviciel Avatar answered Nov 04 '22 21:11

mouviciel