My laptop is quite old. I bought it in 2013. It has "Intel i5-3230M (4) @ 3.200GHz" CPU and 8GB RAM.
Code: Select all
trace("step3.1");
PTE &entry = page_table[entry_offset];
trace("step3.2");
entry.p = 1;
entry.rw = 1;
trace("step3.3");
entry.user_or_supervisor = user_level;
trace("step3.4");
entry.reserved1 = 0;
trace("step3.4.1");
entry.access = 0;
trace("step3.4.2");
entry.dirty = 0;
trace("step3.4.3");
entry.reserved2 = 0;
trace("step3.4.4");
entry.avail = 0;
trace("step3.5");
entry.address =
reinterpret_cast<uint32_t>(physical_address) >> 12; // save high 20bit
trace("step4");
}
I have read the assembly code, can't find anything weird.
Code: Select all
400069fe: 8b 45 d8 mov -0x28(%ebp),%eax
40006a01: 0f b6 50 01 movzbl 0x1(%eax),%edx
40006a05: 83 e2 f1 and $0xfffffff1,%edx
40006a08: 88 50 01 mov %dl,0x1(%eax)
https://github.com/stskyblade/StarOS/tr ... ocess-soft
https://github.com/stskyblade/StarOS/bl ... g.cpp#L120
How to build:
git clone -b dev-process-soft https://github.com/stskyblade/StarOS.git
cd StarOS
mkdir build
cd build
cmake -DUSB_DEVICE:STRING=/dev/sda .. # be very careful. /dev/sda is the device where my code will burn the disk image into
cmake --build . --target burn # Burning image happends here
Then restart computer from the hard disk above in IDE mode. My kernel only supports IDE mode of SATA disk.