OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:14 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 2:15 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
klange wrote:
Under the menu labeled 视图, can you select "compatmonitor0", enter the command "info tlb", and post the results?

Image

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 2:23 am 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
It does look like you are successfully mapping 0xFD000000, but I suspect that QEMU is ignoring either your writes or your reads to the region since you don't actually have a framebuffer set up. It's also possible something is going wrong with your pointer code - native C# stuff is a mysterious black box to me.

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 2:24 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
klange wrote:
It does look like you are successfully mapping 0xFD000000, but I suspect that QEMU is ignoring either your writes or your reads to the region since you don't actually have a framebuffer set up. It's also possible something is going wrong with your pointer code - native C# stuff is a mysterious black box to me.


no it just my compiler converted the c# to nasm not c# native things

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 2:43 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
klange wrote:
It does look like you are successfully mapping 0xFD000000, but I suspect that QEMU is ignoring either your writes or your reads to the region since you don't actually have a framebuffer set up. It's also possible something is going wrong with your pointer code - native C# stuff is a mysterious black box to me.


I also tried pmemsave to make a memory dump. The value is true zero.

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 4:06 am 
Offline
Member
Member

Joined: Sat Jul 02, 2016 7:02 am
Posts: 207
Is the frame buffer mapped as cached, write-back? What if you try to write to it before/without enabling the paging?

Edit: The top-left corner of the VM display, before and after "set {char}0xfd000000=0xaa" from gdb:

Before:
Image

After:
Image


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 8:18 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
linuxyne wrote:
Is the frame buffer mapped as cached, write-back? What if you try to write to it before/without enabling the paging?

Edit: The top-left corner of the VM display, before and after "set {char}0xfd000000=0xaa" from gdb:

Before:
Image

After:
Image


if you disable paging you are no longer in long mode

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 9:34 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
klange wrote:
It does look like you are successfully mapping 0xFD000000, but I suspect that QEMU is ignoring either your writes or your reads to the region since you don't actually have a framebuffer set up. It's also possible something is going wrong with your pointer code - native C# stuff is a mysterious black box to me.


when i enable qemu debug and write to 0xe0000000 it displays
Code:
Invalid access at addr 0xE0000000, size 8, region '(null)', reason: rejected

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 10:03 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
nifanfa wrote:
when i enable qemu debug and write to 0xe0000000 it displays
Code:
Invalid access at addr 0xE0000000, size 8, region '(null)', reason: rejected

This error means you have mapped that address correctly in your page tables, but QEMU is ignoring your reads and writes because there's nothing at that address.

It sounds like your code to map the page tables works fine. You don't see anything appear when you write to the linear frame buffer because there is no linear frame buffer in text mode.


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 10:27 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
Octocontrabass wrote:
nifanfa wrote:
when i enable qemu debug and write to 0xe0000000 it displays
Code:
Invalid access at addr 0xE0000000, size 8, region '(null)', reason: rejected

This error means you have mapped that address correctly in your page tables, but QEMU is ignoring your reads and writes because there's nothing at that address.

It sounds like your code to map the page tables works fine. You don't see anything appear when you write to the linear frame buffer because there is no linear frame buffer in text mode.


Image

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 10:36 am 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
nifanfa wrote:
Octocontrabass wrote:
nifanfa wrote:
when i enable qemu debug and write to 0xe0000000 it displays
Code:
Invalid access at addr 0xE0000000, size 8, region '(null)', reason: rejected

This error means you have mapped that address correctly in your page tables, but QEMU is ignoring your reads and writes because there's nothing at that address.

It sounds like your code to map the page tables works fine. You don't see anything appear when you write to the linear frame buffer because there is no linear frame buffer in text mode.


Image


0xC0000000 - 0xFFFFFFFF are inaccessible

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 10:37 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
What happens if you use the framebuffer address provided by your bootloader instead of 0xFD000000?


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Sun Jan 09, 2022 7:48 pm 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
Octocontrabass wrote:
What happens if you use the framebuffer address provided by your bootloader instead of 0xFD000000?

The address which provided by boot loader is 0xFE000000 but it still not work

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Mon Jan 10, 2022 2:42 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Are you halting the CPU after you write to the framebuffer? Some versions of QEMU will not display screen updates that happen shortly before the CPU halts.

What type of framebuffer did you request in your multiboot header?


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Mon Jan 10, 2022 10:30 pm 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
Octocontrabass wrote:
Are you halting the CPU after you write to the framebuffer? Some versions of QEMU will not display screen updates that happen shortly before the CPU halts.

What type of framebuffer did you request in your multiboot header?


forget about the framebuffer. the real problem is that it can't access 0xc0000000-0xffffffff
i just tried to map the bar0 that provided by a pci device. it occured the same problem
Code:
Invalid access at addr 0xFD000000, size 8, region '(null)', reason: rejected

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
 Post subject: Re: Help! I can't write at 0xFE000000
PostPosted: Mon Jan 10, 2022 11:12 pm 
Offline
Member
Member

Joined: Tue Aug 17, 2021 10:40 am
Posts: 104
Location: CN
Octocontrabass wrote:
Are you halting the CPU after you write to the framebuffer? Some versions of QEMU will not display screen updates that happen shortly before the CPU halts.

What type of framebuffer did you request in your multiboot header?


i can access 0xFD000000 before entering long mode

_________________
My github: https://github.com/nifanfa


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot], Sa41848 and 62 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group