113PDCLAB-Course / linuxOS_HW1

The Project of Linux Operation System on Falling 2023.
0 stars 0 forks source link

請問助教這個東西對不對 #7

Open TheRiseOfDavid opened 1 week ago

TheRiseOfDavid commented 1 week ago

Environment

64bit x86 架構 asm 編譯 linux kernel 6.11.5

Q1 result

  • [ ] 這樣結果正確嗎?
    
    ===========================Before Fork==================================
    pid=1936: global variable global_a:
    Offest of logical address:[0x564033932010]   Physical address:[0x333c68e7]
    ========================================================================
    llllllllllllllllllllllllll  After Fork by child  llllllllllllllllllllllllllllllll
    ******* pid=1937: global variable global_a:
    ******* Offset of logical address:[0x564033932010]   Physical address:[0x333c6885]
    llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
    ____________________________________________________________________________
    iiiiiiiiiiiiiiiiiiiiiiiiii  Test copy on write in child  iiiiiiiiiiiiiiiiiiiiiiii
    ******* pid=1937: global variable global_a:
    ******* Offset of logical address:[0x564033932010]   Physical address:[0x398a88e7]
    iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
    ____________________________________________________________________________
    ===========================Before Fork==================================
    pid=1936: global variable global_a:
    Offest of logical address:[0x564033932010]   Physical address:[0x333c68e7]
    ========================================================================
    vvvvvvvvvvvvvvvvvvvvvvvvvv  After Fork by parent  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    pid=1936: global variable global_a:
    ******* Offset of logical address:[0x564033932010]   Physical address:[0x333c68a5]
    vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
### Q2 result
- [ ] 為什麼出來的結果 physical address 前面是 8 digits, 後面是 4 digits.  

global element a[0]: Offest of logical address:[0x5aff6b044040] Physical address:[0x45886a67]

global element a[1999999]: Offest of logical address:[0x5aff6b7e523c] Physical address:[0x11e0]

TheRiseOfDavid commented 1 week ago

記憶體正確檢查方式

Tricky 的寫法 ok 推薦可以修 os costone (os 即時) 去交大修,軟韌最佳課程

TheRiseOfDavid commented 1 week ago

看起來是因為 4096 沒有做 unsigned long