Re: Help! I can't write at 0xFE000000
Posted: Mon Jan 10, 2022 11:43 pm
The Place to Start for Operating System Developers
http://f.osdev.org/
nifanfa wrote:i can access 0xFD000000 before entering long mode
Code: Select all
size 8
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());
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.
Code: Select all
WriteRegister16(device.Bus, device.Slot, device.Function, 0x04, 0x04);
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);