1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
Qemu 7.2.0 My hobbby bootloader seemed to stop working
Description of problem:
I wrote a BIOS bootloader and OS, but updated to QEMU 7.2.0 and now I get an exception in my bootloader.
Specifically I am getting a page fault on the first line of map_pd:
```
next_pdpt:
; PDPT
mov [0xa000 + rdx * 8], rax ; PDPT[rdx] -> PD
and al, 0xfc ;; clear bits 1 and 2
mov rcx, 0
map_pd:
mov [rax + rcx * 8], rdi ; PD[rcx] -> rax
add rdi, 0x200000 ; maps first 512 * 0x200000 or 1 GiB
sub rsi, 1
cmp rsi, 0
je done_map_rest
add rcx, 1
cmp rcx, 512
jb map_pd
add rdx, 1 ; do next GiB
add rax, 0x1000 ; next PD
or rax, (1 | 2)
jmp next_pdpt
```
I am getting the exception:
```
check_exception old: 0xffffffff new 0xe
0: v=0e e=0002 i=0 cpl=0 IP=0008:0000000000001311 pc=0000000000001311 SP=0010:0000000000007bf8 CR2=000000000020c000
RAX=000000000020c000 RBX=00000000000b8040 RCX=0000000000000000 RDX=0000000000000201
RSI=000000000003fe00 RDI=0000008040000083 RBP=0000000000000008 RSP=0000000000007bf8
R8 =0000000000000000 R9 =0000000000000000 R10=0000000000000000 R11=0000000000000000
R12=0000000000000000 R13=0000000000000000 R14=0000000000000000 R15=0000000000000000
RIP=0000000000001311 RFL=00000046 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 0000000000000000 00000000 00009300 DPL=0 DS [-WA]
CS =0008 0000000000000000 00000000 00209a00 DPL=0 CS64 [-R-]
SS =0010 0000000000000000 00000000 00009300 DPL=0 DS [-WA]
DS =0010 0000000000000000 00000000 00009300 DPL=0 DS [-WA]
FS =0010 0000000000000000 00000000 00009300 DPL=0 DS [-WA]
GS =0010 0000000000000000 00000000 00009300 DPL=0 DS [-WA]
LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT
TR =0000 0000000000000000 0000ffff 00008b00 DPL=0 TSS64-busy
GDT= 0000000000001888 00000018
IDT= 0000000090909000 00000000
CR0=80000011 CR2=000000000020c000 CR3=0000000000009000 CR4=00000020
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=0000000000000200 CCD=0000000000000000 CCO=LOGICB
EFER=0000000000000500
```
I am able to read the 0x20c000 address with gdb
Steps to reproduce:
1. clone and build https://github.com/darbysauter/myOS
2. run with `make run` on 7.0.0
3. run with `make run` on 7.2.0 and there is an exception
Additional information:
I looked through the changelogs from 7.1 and 7.2 and nothing stood out to me. Not sure if some behaviour changed or some default changed.
|