Page 3 of 3

Re: Help! I can't write at 0xFE000000

Posted: Mon Jan 10, 2022 11:43 pm
by nifanfa

Re: Help! I can't write at 0xFE000000

Posted: Tue Jan 11, 2022 10:19 am
by Octocontrabass
nifanfa wrote:i can access 0xFD000000 before entering long mode

Code: Select all

size 8
What happens if you use uint instead of ulong?

Re: Help! I can't write at 0xFE000000

Posted: Tue Jan 11, 2022 9:40 pm
by nifanfa
Octocontrabass wrote:
nifanfa wrote:i can access 0xFD000000 before entering long mode

Code: Select all

size 8
What happens if you use uint instead of ulong?

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());

Re: Help! I can't write at 0xFE000000

Posted: Tue Jan 11, 2022 10:50 pm
by Octocontrabass
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.

Re: Help! I can't write at 0xFE000000

Posted: Tue Jan 11, 2022 11:09 pm
by nifanfa
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.
THANK YOU SO MUCH!!!
I CAN'T EXPRESS HOW EXCITED I AM!!!

i thought

Code: Select all

WriteRegister16(device.Bus, device.Slot, device.Function, 0x04, 0x04);
is to enable the pci mmio.

Re: Help! I can't write at 0xFE000000

Posted: Wed Jan 12, 2022 1:01 am
by klange
nifanfa wrote:i thought

Code: Select all

WriteRegister16(device.Bus, device.Slot, device.Function, 0x04, 0x04);
is to enable the pci mmio.
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.

Good catch, Octocontrabass!