https://github.com/nifanfa/CS2ASM
https://github.com/nifanfa/CS2ASM/blob/ ... /Paging.cs
https://github.com/nifanfa/CS2ASM/blob/ ... yPoint.asm
here is the source code
Help! I can't write at 0xFE000000
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Help! I can't write at 0xFE000000
nifanfa wrote:i can access 0xFD000000 before entering long mode
Code: Select all
size 8
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: Help! I can't write at 0xFE000000
Octocontrabass wrote:nifanfa wrote:i can access 0xFD000000 before entering long modeWhat happens if you use uint instead of ulong?Code: Select all
size 8
Code: Select all
Invalid access at addr 0xFD000000, size 4, region '(null)', reason: rejected
Code: Select all
Paging.Map(0xFD000000, 0xFD000000);
uint val = 0;
asm("mov edi,0xFD000000");
asm("mov dword [edi],1024");
asm("mov eax,[edi]");
asm("mov {val},eax");
Console.WriteLine(((ulong)val).ToString());
My github: https://github.com/nifanfa
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Help! I can't write at 0xFE000000
You're disabling MMIO!
You don't need to write anything to the command register. Firmware enables all PCI devices before it loads your bootloader.
You don't need to write anything to the command register. Firmware enables all PCI devices before it loads your bootloader.
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: Help! I can't write at 0xFE000000
THANK YOU SO MUCH!!!Octocontrabass wrote:You're disabling MMIO!
You don't need to write anything to the command register. Firmware enables all PCI devices before it loads your bootloader.
I CAN'T EXPRESS HOW EXCITED I AM!!!
i thought
Code: Select all
WriteRegister16(device.Bus, device.Slot, device.Function, 0x04, 0x04);
My github: https://github.com/nifanfa
Re: Help! I can't write at 0xFE000000
Writing 0x04 to the command register will enable bus mastering, and disable everything else. Don't let the name confuse you, the register does not work by taking 'commands' - it's a bitfield so you need to maintain all of the other bits as you set or unset new ones.nifanfa wrote:i thoughtis to enable the pci mmio.Code: Select all
WriteRegister16(device.Bus, device.Slot, device.Function, 0x04, 0x04);
Good catch, Octocontrabass!