By changing the -c option to -S, I manually run the following
Code:
i686-elf-gcc -S paging.c -o /home/xxxxxx/projects/qios/obj/paging.o -std=c11 -ffreestanding -Wall -Wextra -Werror -masm=intel -g -O0 --verbose -I ~/projects/qios/src/include
The output is exactly the same as I use option '-c'
Code:
Using built-in specs.
COLLECT_GCC=i686-elf-gcc
Target: i686-elf
Configured with: ../gcc-7.2.0/configure --target=i686-elf --prefix=/home/xxxxxx/opt/cross --disable-nls --enable-languages=c,c++ --without-headers
Thread model: single
gcc version 7.2.0 (GCC)
COLLECT_GCC_OPTIONS='-S' '-o' '/home/xxxxxx/projects/qios/obj/paging.o' '-std=c11' '-ffreestanding' '-Wall' '-Wextra' '-Werror' '-masm=intel' '-g' '-O0' '-v' '-I' '/home/xxxxxx/projects/qios/src/include' '-mtune=generic' '-march=pentiumpro'
/home/xxxxxx/opt/cross/libexec/gcc/i686-elf/7.2.0/cc1 -quiet -v -I /home/xxxxxx/projects/qios/src/include paging.c -quiet -dumpbase paging.c -masm=intel -mtune=generic -march=pentiumpro -auxbase-strip /home/xxxxxx/projects/qios/obj/paging.o -g -O0 -Wall -Wextra -Werror -std=c11 -version -ffreestanding -o /home/xxxxxx/projects/qios/obj/paging.o
GNU C11 (GCC) version 7.2.0 (i686-elf)
compiled by GNU C version 7.2.0, GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/xxxxxx/opt/cross/lib/gcc/i686-elf/7.2.0/../../../../i686-elf/sys-include"
ignoring nonexistent directory "/home/xxxxxx/opt/cross/lib/gcc/i686-elf/7.2.0/../../../../i686-elf/include"
#include "..." search starts here:
#include <...> search starts here:
/home/xxxxxx/projects/qios/src/include
/home/xxxxxx/opt/cross/lib/gcc/i686-elf/7.2.0/include
/home/xxxxxx/opt/cross/lib/gcc/i686-elf/7.2.0/include-fixed
End of search list.
GNU C11 (GCC) version 7.2.0 (i686-elf)
compiled by GNU C version 7.2.0, GMP version 6.1.2, MPFR version 3.1.6, MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 01f7fd9f29241f2582c96ff0f48ee445
COMPILER_PATH=/home/xxxxxx/opt/cross/libexec/gcc/i686-elf/7.2.0/:/home/xxxxxx/opt/cross/libexec/gcc/i686-elf/7.2.0/:/home/xxxxxx/opt/cross/libexec/gcc/i686-elf/:/home/xxxxxx/opt/cross/lib/gcc/i686-elf/7.2.0/:/home/xxxxxx/opt/cross/lib/gcc/i686-elf/:/home/xxxxxx/opt/cross/lib/gcc/i686-elf/7.2.0/../../../../i686-elf/bin/
LIBRARY_PATH=/home/xxxxxx/opt/cross/lib/gcc/i686-elf/7.2.0/:/home/xxxxxx/opt/cross/lib/gcc/i686-elf/7.2.0/../../../../i686-elf/lib/
COLLECT_GCC_OPTIONS='-S' '-o' '/home/xxxxxx/projects/qios/obj/paging.o' '-std=c11' '-ffreestanding' '-Wall' '-Wextra' '-Werror' '-masm=intel' '-g' '-O0' '-v' '-I' '/home/xxxxxx/projects/qios/src/include' '-mtune=generic' '-march=pentiumpro'
The output .S assembly file doesn't contain the right section, either.
Code:
.file "paging.c"
.intel_syntax noprefix
.text
.Ltext0:
.type get_cr0, @function
get_cr0:
.LFB6:
.file 1 "../asm.h"
.loc 1 57 0
.cfi_startproc
push ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
sub esp, 16
.loc 1 59 0
/APP
/ 59 "../asm.h" 1
mov eax, cr0
/ 0 "" 2
/NO_APP
mov DWORD PTR [ebp-4], eax
.loc 1 62 0
mov eax, DWORD PTR [ebp-4]
.loc 1 63 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE6:
.size get_cr0, .-get_cr0
.type set_cr0, @function
set_cr0:
.LFB7:
.loc 1 65 0
.cfi_startproc
push ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
.loc 1 66 0
mov eax, DWORD PTR [ebp+8]
/APP
/ 66 "../asm.h" 1
mov cr0, eax
/ 0 "" 2
.loc 1 67 0
/NO_APP
nop
pop ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE7:
.size set_cr0, .-set_cr0
.type set_cr3, @function
set_cr3:
.LFB9:
.loc 1 77 0
.cfi_startproc
push ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
.loc 1 78 0
mov eax, DWORD PTR [ebp+8]
/APP
/ 78 "../asm.h" 1
mov cr3, eax
/ 0 "" 2
.loc 1 79 0
/NO_APP
nop
pop ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE9:
.size set_cr3, .-set_cr3
.type get_cr4, @function
get_cr4:
.LFB10:
.loc 1 81 0
.cfi_startproc
push ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
sub esp, 16
.loc 1 83 0
/APP
/ 83 "../asm.h" 1
mov eax, cr4
/ 0 "" 2
/NO_APP
mov DWORD PTR [ebp-4], eax
.loc 1 86 0
mov eax, DWORD PTR [ebp-4]
.loc 1 87 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE10:
.size get_cr4, .-get_cr4
.type set_cr4, @function
set_cr4:
.LFB11:
.loc 1 89 0
.cfi_startproc
push ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
.loc 1 90 0
mov eax, DWORD PTR [ebp+8]
/APP
/ 90 "../asm.h" 1
mov cr4, eax
/ 0 "" 2
.loc 1 91 0
/NO_APP
nop
pop ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE11:
.size set_cr4, .-set_cr4
.comm _magic,4,4
.comm _addr,4,4
.comm last_page_dir,4,4
.comm last_page_tab,4,4
.comm page_dir_ptr_tab,32,32
.comm page_dir,16384,32
.comm page_tab,8388608,32
.globl map_page
.type map_page, @function
map_page:
.LFB12:
.file 2 "paging.c"
.loc 2 33 0
.cfi_startproc
push ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
push edi
push esi
push ebx
sub esp, 140
.cfi_offset 7, -12
.cfi_offset 6, -16
.cfi_offset 3, -20
.loc 2 34 0
mov eax, DWORD PTR [ebp+12]
mov DWORD PTR [ebp-20], eax
.loc 2 37 0
jmp .L9
.L14:
.LBB2:
.loc 2 38 0
mov eax, DWORD PTR [ebp+8]
shr eax, 30
mov DWORD PTR [ebp-36], eax
.loc 2 39 0
mov eax, DWORD PTR [ebp-36]
mov edx, DWORD PTR page_dir_ptr_tab[4+eax*8]
mov eax, DWORD PTR page_dir_ptr_tab[0+eax*8]
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], edx
.loc 2 41 0
mov eax, DWORD PTR [ebp-32]
and eax, 1
mov DWORD PTR [ebp-64], eax
mov eax, DWORD PTR [ebp-28]
and eax, 0
mov DWORD PTR [ebp-60], eax
mov eax, DWORD PTR [ebp-64]
mov edx, DWORD PTR [ebp-60]
mov ebx, eax
xor bh, 0
mov DWORD PTR [ebp-56], ebx
mov eax, edx
xor ah, 0
mov DWORD PTR [ebp-52], eax
mov eax, DWORD PTR [ebp-52]
or eax, DWORD PTR [ebp-56]
test eax, eax
je .L10
.loc 2 41 0 is_stmt 0 discriminator 1
mov eax, DWORD PTR [ebp-32]
and eax, -4096
mov DWORD PTR [ebp-72], eax
mov eax, DWORD PTR [ebp-28]
and eax, 1048575
mov DWORD PTR [ebp-68], eax
mov eax, DWORD PTR [ebp-72]
mov edx, DWORD PTR [ebp-68]
mov ebx, eax
xor bh, 0
mov esi, ebx
mov eax, edx
xor ah, 0
mov edi, eax
mov eax, edi
or eax, esi
test eax, eax
jne .L11
.L10:
.loc 2 42 0 is_stmt 1
mov eax, DWORD PTR last_page_dir
mov edx, 0
mov ecx, eax
and ecx, -4096
mov DWORD PTR [ebp-80], ecx
mov eax, edx
and eax, 1048575
mov DWORD PTR [ebp-76], eax
mov eax, DWORD PTR [ebp-80]
mov edx, DWORD PTR [ebp-76]
mov ebx, eax
or ebx, 1
mov DWORD PTR [ebp-88], ebx
mov eax, edx
or ah, 0
mov DWORD PTR [ebp-84], eax
mov eax, DWORD PTR [ebp-36]
mov ecx, DWORD PTR [ebp-88]
mov ebx, DWORD PTR [ebp-84]
mov DWORD PTR page_dir_ptr_tab[0+eax*8], ecx
mov DWORD PTR page_dir_ptr_tab[4+eax*8], ebx
mov eax, DWORD PTR [ebp-36]
mov edx, DWORD PTR page_dir_ptr_tab[4+eax*8]
mov eax, DWORD PTR page_dir_ptr_tab[0+eax*8]
mov DWORD PTR [ebp-32], eax
mov DWORD PTR [ebp-28], edx
.loc 2 43 0
mov eax, DWORD PTR last_page_dir
add eax, 4096
mov DWORD PTR last_page_dir, eax
.L11:
.loc 2 46 0
mov eax, DWORD PTR [ebp-32]
and eax, -4096
mov edx, eax
mov eax, DWORD PTR [ebp+8]
shr eax, 18
and eax, 4088
or eax, edx
mov DWORD PTR [ebp-40], eax
.loc 2 48 0
mov eax, DWORD PTR [ebp-40]
mov edx, DWORD PTR [eax+4]
mov eax, DWORD PTR [eax]
mov ecx, eax
and ecx, 1
mov DWORD PTR [ebp-96], ecx
mov eax, edx
and eax, 0
mov DWORD PTR [ebp-92], eax
mov eax, DWORD PTR [ebp-96]
mov edx, DWORD PTR [ebp-92]
mov ebx, eax
xor bh, 0
mov DWORD PTR [ebp-144], ebx
mov eax, edx
xor ah, 0
mov DWORD PTR [ebp-140], eax
mov eax, DWORD PTR [ebp-144]
mov edx, DWORD PTR [ebp-140]
mov ecx, edx
or ecx, eax
mov eax, ecx
test eax, eax
je .L12
.loc 2 48 0 is_stmt 0 discriminator 1
mov eax, DWORD PTR [ebp-40]
mov edx, DWORD PTR [eax+4]
mov eax, DWORD PTR [eax]
mov ebx, eax
and ebx, -4096
mov DWORD PTR [ebp-104], ebx
mov eax, edx
and eax, 1048575
mov DWORD PTR [ebp-100], eax
mov eax, DWORD PTR [ebp-104]
mov edx, DWORD PTR [ebp-100]
mov ecx, eax
xor ch, 0
mov DWORD PTR [ebp-152], ecx
mov eax, edx
xor ah, 0
mov DWORD PTR [ebp-148], eax
mov eax, DWORD PTR [ebp-152]
mov edx, DWORD PTR [ebp-148]
mov ebx, edx
or ebx, eax
mov eax, ebx
test eax, eax
jne .L13
.L12:
.loc 2 49 0 is_stmt 1
mov eax, DWORD PTR last_page_tab
mov edx, 0
mov ecx, eax
and ecx, -4096
mov DWORD PTR [ebp-112], ecx
mov eax, edx
and eax, 1048575
mov DWORD PTR [ebp-108], eax
mov eax, DWORD PTR [ebp-112]
mov edx, DWORD PTR [ebp-108]
mov ebx, eax
or ebx, 3
mov DWORD PTR [ebp-120], ebx
mov eax, edx
or ah, 0
mov DWORD PTR [ebp-116], eax
mov eax, DWORD PTR [ebp-40]
mov ecx, DWORD PTR [ebp-120]
mov ebx, DWORD PTR [ebp-116]
mov DWORD PTR [eax], ecx
mov DWORD PTR [eax+4], ebx
.loc 2 50 0
mov eax, DWORD PTR last_page_tab
add eax, 4096
mov DWORD PTR last_page_tab, eax
.L13:
.loc 2 52 0
mov eax, DWORD PTR [ebp-40]
mov edx, DWORD PTR [eax+4]
mov eax, DWORD PTR [eax]
and eax, -4096
mov edx, eax
mov eax, DWORD PTR [ebp+8]
shr eax, 9
and eax, 4088
or eax, edx
mov DWORD PTR [ebp-44], eax
.loc 2 53 0
mov eax, DWORD PTR [ebp+16]
mov edx, 0
mov ecx, eax
and ecx, -4096
mov DWORD PTR [ebp-128], ecx
mov eax, edx
and eax, 1048575
mov DWORD PTR [ebp-124], eax
mov eax, DWORD PTR [ebp-128]
mov edx, DWORD PTR [ebp-124]
mov ebx, eax
or ebx, 3
mov DWORD PTR [ebp-136], ebx
mov eax, edx
or ah, 0
mov DWORD PTR [ebp-132], eax
mov eax, DWORD PTR [ebp-44]
mov ecx, DWORD PTR [ebp-136]
mov ebx, DWORD PTR [ebp-132]
mov DWORD PTR [eax], ecx
mov DWORD PTR [eax+4], ebx
.LBE2:
.loc 2 37 0
add DWORD PTR [ebp+8], 4096
add DWORD PTR [ebp+16], 4096
sub DWORD PTR [ebp-20], 4096
.L9:
.loc 2 37 0 is_stmt 0 discriminator 1
cmp DWORD PTR [ebp-20], 0
jne .L14
.loc 2 55 0 is_stmt 1
nop
add esp, 140
pop ebx
.cfi_restore 3
pop esi
.cfi_restore 6
pop edi
.cfi_restore 7
pop ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE12:
.size map_page, .-map_page
.globl virt_to_phys
.type virt_to_phys, @function
virt_to_phys:
.LFB13:
.loc 2 57 0
.cfi_startproc
push ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
push edi
push esi
push ebx
sub esp, 68
.cfi_offset 7, -12
.cfi_offset 6, -16
.cfi_offset 3, -20
.loc 2 58 0
mov eax, DWORD PTR [ebp+8]
shr eax, 30
mov edx, DWORD PTR page_dir_ptr_tab[4+eax*8]
mov eax, DWORD PTR page_dir_ptr_tab[0+eax*8]
mov DWORD PTR [ebp-24], eax
mov DWORD PTR [ebp-20], edx
.loc 2 59 0
mov eax, DWORD PTR [ebp-24]
and eax, 1
mov ecx, eax
mov eax, DWORD PTR [ebp-20]
and eax, 0
mov ebx, eax
mov eax, ecx
xor ah, 0
mov esi, eax
mov eax, ebx
xor ah, 0
mov edi, eax
mov eax, edi
or eax, esi
test eax, eax
jne .L16
.loc 2 60 0
mov eax, 0
jmp .L17
.L16:
.loc 2 62 0
mov eax, DWORD PTR [ebp-24]
and eax, -4096
mov edx, eax
mov eax, DWORD PTR [ebp+8]
shr eax, 18
and eax, 4088
or eax, edx
mov DWORD PTR [ebp-28], eax
.loc 2 63 0
mov eax, DWORD PTR [ebp-28]
mov edx, DWORD PTR [eax+4]
mov eax, DWORD PTR [eax]
mov edi, eax
and edi, 1
mov DWORD PTR [ebp-56], edi
mov eax, edx
and eax, 0
mov DWORD PTR [ebp-52], eax
mov eax, DWORD PTR [ebp-56]
mov edx, DWORD PTR [ebp-52]
mov edi, eax
xor edi, 0
mov DWORD PTR [ebp-72], edi
mov eax, edx
xor ah, 0
mov DWORD PTR [ebp-68], eax
mov ebx, DWORD PTR [ebp-72]
mov esi, DWORD PTR [ebp-68]
mov eax, esi
or eax, ebx
test eax, eax
jne .L18
.loc 2 64 0
mov eax, 0
jmp .L17
.L18:
.loc 2 66 0
mov eax, DWORD PTR [ebp-28]
mov edx, DWORD PTR [eax+4]
mov eax, DWORD PTR [eax]
and eax, -4096
mov edx, eax
mov eax, DWORD PTR [ebp+8]
shr eax, 9
and eax, 4088
or eax, edx
mov DWORD PTR [ebp-32], eax
.loc 2 67 0
mov eax, DWORD PTR [ebp-32]
mov edx, DWORD PTR [eax+4]
mov eax, DWORD PTR [eax]
mov ecx, eax
and ecx, 1
mov DWORD PTR [ebp-64], ecx
mov eax, edx
and eax, 0
mov DWORD PTR [ebp-60], eax
mov eax, DWORD PTR [ebp-64]
mov edx, DWORD PTR [ebp-60]
mov ebx, eax
xor bh, 0
mov DWORD PTR [ebp-80], ebx
mov eax, edx
xor ah, 0
mov DWORD PTR [ebp-76], eax
mov ebx, DWORD PTR [ebp-80]
mov esi, DWORD PTR [ebp-76]
mov eax, esi
or eax, ebx
test eax, eax
jne .L19
.loc 2 68 0
mov eax, 0
jmp .L17
.L19:
.loc 2 70 0
mov eax, DWORD PTR [ebp-32]
mov edx, DWORD PTR [eax+4]
mov eax, DWORD PTR [eax]
and eax, -4096
mov edx, eax
mov eax, DWORD PTR [ebp+8]
and eax, 4095
or eax, edx
mov DWORD PTR [ebp-36], eax
.loc 2 71 0
mov eax, DWORD PTR [ebp-36]
.L17:
.loc 2 72 0
add esp, 68
pop ebx
.cfi_restore 3
pop esi
.cfi_restore 6
pop edi
.cfi_restore 7
pop ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE13:
.size virt_to_phys, .-virt_to_phys
.globl early_init_paging
.type early_init_paging, @function
early_init_paging:
.LFB14:
.loc 2 74 0
.cfi_startproc
push ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
sub esp, 32
.loc 2 75 0
mov DWORD PTR last_page_dir, OFFSET FLAT:page_dir
.loc 2 76 0
mov DWORD PTR last_page_tab, OFFSET FLAT:page_tab
.loc 2 78 0
mov edx, DWORD PTR [ebp+12]
mov eax, DWORD PTR [ebp+8]
sub edx, eax
mov eax, edx
mov DWORD PTR [ebp-4], eax
.loc 2 81 0
mov eax, DWORD PTR [ebp-4]
and eax, -4096
add eax, 4096
mov DWORD PTR [ebp-8], eax
.loc 2 82 0
sub esp, 4
push 0
push DWORD PTR [ebp-8]
push 0
call map_page
add esp, 16
.loc 2 83 0
sub esp, 4
push 1245184
call virt_to_phys
add esp, 8
cmp eax, 1245184
je .L21
.L22:
.loc 2 84 0 discriminator 1
jmp .L22
.L21:
.loc 2 89 0
mov eax, DWORD PTR [ebp+24]
and eax, -4096
mov DWORD PTR [ebp-12], eax
.loc 2 90 0
mov eax, DWORD PTR [ebp+24]
mov eax, DWORD PTR [eax]
mov DWORD PTR [ebp-16], eax
.loc 2 91 0
mov eax, DWORD PTR [ebp-16]
and eax, 4095
test eax, eax
je .L23
.loc 2 91 0 is_stmt 0 discriminator 1
mov eax, DWORD PTR [ebp-16]
and eax, -4096
add eax, 4096
jmp .L24
.L23:
.loc 2 91 0 discriminator 2
mov eax, DWORD PTR [ebp-16]
.L24:
.loc 2 91 0 discriminator 4
mov DWORD PTR [ebp-8], eax
.loc 2 92 0 is_stmt 1 discriminator 4
sub esp, 4
push DWORD PTR [ebp-12]
push DWORD PTR [ebp-8]
push DWORD PTR [ebp-12]
call map_page
add esp, 16
.loc 2 95 0 discriminator 4
mov edx, DWORD PTR [ebp+12]
mov eax, DWORD PTR [ebp+8]
cmp edx, eax
je .L25
.loc 2 95 0 is_stmt 0 discriminator 1
mov edx, DWORD PTR [ebp+12]
mov eax, DWORD PTR [ebp+8]
mov ecx, edx
sub ecx, eax
mov edx, DWORD PTR [ebp+8]
mov eax, DWORD PTR [ebp+12]
sub edx, eax
mov eax, edx
add eax, ecx
add eax, 11538432
jmp .L26
.L25:
.loc 2 95 0 discriminator 2
mov edx, DWORD PTR [ebp+12]
mov eax, DWORD PTR [ebp+8]
sub edx, eax
mov eax, edx
add eax, 11534336
.L26:
.loc 2 95 0 discriminator 4
mov DWORD PTR [ebp-8], eax
.loc 2 96 0 is_stmt 1 discriminator 4
mov DWORD PTR [ebp-20], -1072693248
.loc 2 97 0 discriminator 4
mov eax, DWORD PTR [ebp+8]
and eax, 4095
test eax, eax
je .L27
.loc 2 97 0 is_stmt 0 discriminator 1
mov eax, DWORD PTR [ebp+8]
and eax, -4096
add eax, 4096
jmp .L28
.L27:
.loc 2 97 0 discriminator 2
mov eax, DWORD PTR [ebp+8]
.L28:
.loc 2 97 0 discriminator 4
mov DWORD PTR [ebp-24], eax
.loc 2 98 0 is_stmt 1 discriminator 4
sub esp, 4
push DWORD PTR [ebp-24]
push DWORD PTR [ebp-8]
push DWORD PTR [ebp-20]
call map_page
add esp, 16
.loc 2 99 0 discriminator 4
sub esp, 4
push -1072693248
call virt_to_phys
add esp, 8
mov edx, eax
mov eax, DWORD PTR [ebp+8]
cmp edx, eax
je .L29
.L30:
.loc 2 100 0 discriminator 2
jmp .L30
.L29:
.loc 2 104 0
sub esp, 4
push -1069532084
call virt_to_phys
add esp, 8
cmp eax, 4209740
je .L31
.L32:
.loc 2 105 0 discriminator 3
jmp .L32
.L31:
.loc 2 110 0
mov eax, OFFSET FLAT:page_dir_ptr_tab
sub esp, 4
push eax
call set_cr3
add esp, 8
.loc 2 113 0
call get_cr4
mov DWORD PTR [ebp-28], eax
.loc 2 114 0
or DWORD PTR [ebp-28], 32
.loc 2 115 0
sub esp, 4
push DWORD PTR [ebp-28]
call set_cr4
add esp, 8
.loc 2 118 0
call get_cr0
mov DWORD PTR [ebp-32], eax
.loc 2 119 0
or DWORD PTR [ebp-32], -2147483648
.loc 2 120 0
sub esp, 4
push DWORD PTR [ebp-32]
call set_cr0
add esp, 8
.loc 2 121 0
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE14:
.size early_init_paging, .-early_init_paging
.Letext0:
.file 3 "/home/tongko/projects/qios/src/include/stddef.h"
.file 4 "/home/tongko/opt/cross/lib/gcc/i686-elf/7.2.0/include/stdint-gcc.h"
.file 5 "../ktypedef.h"
.file 6 "paging.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x3de
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF48
.byte 0xc
.long .LASF49
.long .LASF50
.long .Ltext0
.long .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.byte 0x4
.byte 0x5
.long .LASF0
.uleb128 0x3
.long .LASF7
.byte 0x3
.byte 0x1c
.long 0x37
.uleb128 0x2
.byte 0x4
.byte 0x7
.long .LASF1
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x2
.byte 0x1
.byte 0x6
.long .LASF2
.uleb128 0x2
.byte 0x2
.byte 0x5
.long .LASF3
.uleb128 0x2
.byte 0x8
.byte 0x5
.long .LASF4
.uleb128 0x2
.byte 0x1
.byte 0x8
.long .LASF5
.uleb128 0x2
.byte 0x2
.byte 0x7
.long .LASF6
.uleb128 0x3
.long .LASF8
.byte 0x4
.byte 0x34
.long 0x37
.uleb128 0x3
.long .LASF9
.byte 0x4
.byte 0x37
.long 0x7e
.uleb128 0x2
.byte 0x8
.byte 0x7
.long .LASF10
.uleb128 0x2
.byte 0x4
.byte 0x7
.long .LASF11
.uleb128 0x3
.long .LASF12
.byte 0x5
.byte 0x12
.long 0x68
.uleb128 0x3
.long .LASF13
.byte 0x5
.byte 0x14
.long 0x68
.uleb128 0x5
.long .LASF51
.byte 0x10
.byte 0x6
.byte 0x1d
.long 0xdf
.uleb128 0x6
.long .LASF14
.byte 0x6
.byte 0x1e
.long 0x68
.byte 0
.uleb128 0x6
.long .LASF15
.byte 0x6
.byte 0x1f
.long 0x68
.byte 0x4
.uleb128 0x6
.long .LASF16
.byte 0x6
.byte 0x20
.long 0x68
.byte 0x8
.uleb128 0x6
.long .LASF17
.byte 0x6
.byte 0x21
.long 0x68
.byte 0xc
.byte 0
.uleb128 0x3
.long .LASF18
.byte 0x6
.byte 0x22
.long 0xa2
.uleb128 0x7
.long .LASF19
.byte 0x2
.byte 0xd
.long 0x68
.uleb128 0x5
.byte 0x3
.long _magic
.uleb128 0x7
.long .LASF20
.byte 0x2
.byte 0xe
.long 0x68
.uleb128 0x5
.byte 0x3
.long _addr
.uleb128 0x7
.long .LASF21
.byte 0x2
.byte 0xf
.long 0x11d
.uleb128 0x5
.byte 0x3
.long last_page_dir
.uleb128 0x8
.byte 0x4
.long 0x73
.uleb128 0x7
.long .LASF22
.byte 0x2
.byte 0x10
.long 0x11d
.uleb128 0x5
.byte 0x3
.long last_page_tab
.uleb128 0x9
.long 0x73
.long 0x144
.uleb128 0xa
.long 0x37
.byte 0x3
.byte 0
.uleb128 0x7
.long .LASF23
.byte 0x2
.byte 0x11
.long 0x134
.uleb128 0x5
.byte 0x3
.long page_dir_ptr_tab
.uleb128 0x9
.long 0x73
.long 0x166
.uleb128 0xb
.long 0x37
.value 0x7ff
.byte 0
.uleb128 0x7
.long .LASF24
.byte 0x2
.byte 0x12
.long 0x155
.uleb128 0x5
.byte 0x3
.long page_dir
.uleb128 0x9
.long 0x73
.long 0x18a
.uleb128 0xc
.long 0x37
.long 0xfffff
.byte 0
.uleb128 0x7
.long .LASF25
.byte 0x2
.byte 0x13
.long 0x177
.uleb128 0x5
.byte 0x3
.long page_tab
.uleb128 0xd
.long .LASF36
.byte 0x2
.byte 0x4a
.long .LFB14
.long .LFE14-.LFB14
.uleb128 0x1
.byte 0x9c
.long 0x23d
.uleb128 0xe
.long .LASF26
.byte 0x2
.byte 0x4a
.long 0xdf
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0xe
.long .LASF27
.byte 0x2
.byte 0x4a
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 16
.uleb128 0xf
.long .LASF28
.byte 0x2
.byte 0x4e
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -12
.uleb128 0xf
.long .LASF29
.byte 0x2
.byte 0x51
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -16
.uleb128 0xf
.long .LASF30
.byte 0x2
.byte 0x59
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -20
.uleb128 0xf
.long .LASF31
.byte 0x2
.byte 0x5a
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -24
.uleb128 0x10
.string "kvb"
.byte 0x2
.byte 0x60
.long 0x8c
.uleb128 0x2
.byte 0x91
.sleb128 -28
.uleb128 0x10
.string "pss"
.byte 0x2
.byte 0x61
.long 0x97
.uleb128 0x2
.byte 0x91
.sleb128 -32
.uleb128 0x10
.string "cr4"
.byte 0x2
.byte 0x71
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -36
.uleb128 0x10
.string "cr0"
.byte 0x2
.byte 0x76
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -40
.byte 0
.uleb128 0x11
.long .LASF52
.byte 0x2
.byte 0x39
.long 0x97
.long .LFB13
.long .LFE13-.LFB13
.uleb128 0x1
.byte 0x9c
.long 0x29d
.uleb128 0xe
.long .LASF32
.byte 0x2
.byte 0x39
.long 0x8c
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0xf
.long .LASF33
.byte 0x2
.byte 0x3a
.long 0x73
.uleb128 0x2
.byte 0x91
.sleb128 -32
.uleb128 0xf
.long .LASF34
.byte 0x2
.byte 0x3e
.long 0x11d
.uleb128 0x2
.byte 0x91
.sleb128 -36
.uleb128 0xf
.long .LASF35
.byte 0x2
.byte 0x42
.long 0x11d
.uleb128 0x2
.byte 0x91
.sleb128 -40
.uleb128 0x10
.string "ret"
.byte 0x2
.byte 0x46
.long 0x97
.uleb128 0x2
.byte 0x91
.sleb128 -44
.byte 0
.uleb128 0x12
.long .LASF37
.byte 0x2
.byte 0x21
.long .LFB12
.long .LFE12-.LFB12
.uleb128 0x1
.byte 0x9c
.long 0x329
.uleb128 0xe
.long .LASF38
.byte 0x2
.byte 0x21
.long 0x8c
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0xe
.long .LASF39
.byte 0x2
.byte 0x21
.long 0x2c
.uleb128 0x2
.byte 0x91
.sleb128 4
.uleb128 0xe
.long .LASF40
.byte 0x2
.byte 0x21
.long 0x97
.uleb128 0x2
.byte 0x91
.sleb128 8
.uleb128 0x10
.string "c"
.byte 0x2
.byte 0x22
.long 0x2c
.uleb128 0x2
.byte 0x91
.sleb128 -28
.uleb128 0x13
.long .LBB2
.long .LBE2-.LBB2
.uleb128 0x10
.string "p"
.byte 0x2
.byte 0x26
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -44
.uleb128 0xf
.long .LASF41
.byte 0x2
.byte 0x27
.long 0x73
.uleb128 0x2
.byte 0x91
.sleb128 -40
.uleb128 0xf
.long .LASF42
.byte 0x2
.byte 0x2e
.long 0x11d
.uleb128 0x2
.byte 0x91
.sleb128 -48
.uleb128 0xf
.long .LASF43
.byte 0x2
.byte 0x34
.long 0x11d
.uleb128 0x2
.byte 0x91
.sleb128 -52
.byte 0
.byte 0
.uleb128 0x14
.long .LASF44
.byte 0x1
.byte 0x59
.long .LFB11
.long .LFE11-.LFB11
.uleb128 0x1
.byte 0x9c
.long 0x34d
.uleb128 0x15
.string "val"
.byte 0x1
.byte 0x59
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 0
.byte 0
.uleb128 0x16
.long .LASF53
.byte 0x1
.byte 0x51
.long 0x68
.long .LFB10
.long .LFE10-.LFB10
.uleb128 0x1
.byte 0x9c
.long 0x375
.uleb128 0x10
.string "ret"
.byte 0x1
.byte 0x52
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -12
.byte 0
.uleb128 0x14
.long .LASF45
.byte 0x1
.byte 0x4d
.long .LFB9
.long .LFE9-.LFB9
.uleb128 0x1
.byte 0x9c
.long 0x399
.uleb128 0x15
.string "val"
.byte 0x1
.byte 0x4d
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 0
.byte 0
.uleb128 0x14
.long .LASF46
.byte 0x1
.byte 0x41
.long .LFB7
.long .LFE7-.LFB7
.uleb128 0x1
.byte 0x9c
.long 0x3bd
.uleb128 0x15
.string "val"
.byte 0x1
.byte 0x41
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 0
.byte 0
.uleb128 0x17
.long .LASF47
.byte 0x1
.byte 0x39
.long 0x68
.long .LFB6
.long .LFE6-.LFB6
.uleb128 0x1
.byte 0x9c
.uleb128 0x10
.string "ret"
.byte 0x1
.byte 0x3a
.long 0x68
.uleb128 0x2
.byte 0x91
.sleb128 -12
.byte 0
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x13
.byte 0x1
.uleb128 0x3
.uleb128 0xe
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0xf
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0x1
.byte 0x1
.uleb128 0x49
.uleb128 0x13
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xa
.uleb128 0x21
.byte 0
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2f
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0xb
.uleb128 0x21
.byte 0
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2f
.uleb128 0x5
.byte 0
.byte 0
.uleb128 0xc
.uleb128 0x21
.byte 0
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2f
.uleb128 0x6
.byte 0
.byte 0
.uleb128 0xd
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xe
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xf
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x10
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x11
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x12
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x13
.uleb128 0xb
.byte 0x1
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.byte 0
.byte 0
.uleb128 0x14
.uleb128 0x2e
.byte 0x1
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x15
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x16
.uleb128 0x2e
.byte 0x1
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x17
.uleb128 0x2e
.byte 0x1
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x1c
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long .Ltext0
.long .Letext0-.Ltext0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF35:
.string "pg_tab"
.LASF50:
.string "/home/tongko/projects/qios/src/arch/x86/boot"
.LASF38:
.string "from"
.LASF33:
.string "pdptr_e"
.LASF36:
.string "early_init_paging"
.LASF39:
.string "count"
.LASF14:
.string "physical_start"
.LASF18:
.string "kernel_mem_info_t"
.LASF28:
.string "ksize"
.LASF9:
.string "uint64_t"
.LASF19:
.string "_magic"
.LASF49:
.string "paging.c"
.LASF26:
.string "kmem_info"
.LASF24:
.string "page_dir"
.LASF45:
.string "set_cr3"
.LASF44:
.string "set_cr4"
.LASF5:
.string "unsigned char"
.LASF1:
.string "long unsigned int"
.LASF6:
.string "short unsigned int"
.LASF7:
.string "size_t"
.LASF42:
.string "pg_dir_entry"
.LASF15:
.string "physical_end"
.LASF32:
.string "vaddr"
.LASF25:
.string "page_tab"
.LASF40:
.string "physical"
.LASF47:
.string "get_cr0"
.LASF46:
.string "set_cr0"
.LASF53:
.string "get_cr4"
.LASF37:
.string "map_page"
.LASF11:
.string "unsigned int"
.LASF27:
.string "mb2_addr"
.LASF10:
.string "long long unsigned int"
.LASF41:
.string "pdpte_i"
.LASF52:
.string "virt_to_phys"
.LASF16:
.string "virtual_start"
.LASF21:
.string "last_page_dir"
.LASF4:
.string "long long int"
.LASF29:
.string "offset"
.LASF34:
.string "pg_dir"
.LASF3:
.string "short int"
.LASF51:
.string "kernel_mem_info"
.LASF43:
.string "pg_tab_entry"
.LASF8:
.string "uint32_t"
.LASF0:
.string "long int"
.LASF2:
.string "signed char"
.LASF17:
.string "virtual_end"
.LASF13:
.string "paddr_t"
.LASF23:
.string "page_dir_ptr_tab"
.LASF31:
.string "size"
.LASF30:
.string "mb2_loaded"
.LASF48:
.string "GNU C11 7.2.0 -masm=intel -mtune=generic -march=pentiumpro -g -O0 -std=c11 -ffreestanding"
.LASF20:
.string "_addr"
.LASF12:
.string "vaddr_t"
.LASF22:
.string "last_page_tab"
.ident "GCC: (GNU) 7.2.0"