fenriswolf24
Posts: 2
Joined: Sun May 26, 2019 8:50 am
Location: Germany

GPIO access with assembly using QEMU

Sun May 26, 2019 9:19 am

Hey guys,
i´m not sure if this is the right place to ask this question, but i think it´s at least somewhat fitting. I´m currently evaluating the RPi as a learning platform for the assembly language and basic computer architecture at my university. Unfortunately it´s not possible to give away a Rpi to every student, so i´m trying to use QEMU to emulate the RPi for home use, so students could write parts of the code at home and test it before putting it on the real hardware at the university. Unfortunately QEMU does not emulate the bcm2835, so there is no gpiomem file. So my idea was to copy the gpiomem file from a real RPi and write an emulation for basic periphery like a LED and a button and make them write/read the file. The user could basically just change the memory mapping in his assembly code and would be good to go. Now i´m currently having a problem, i couldn't find a way to copy the gpiomem file from my RPi. Has anyone ever tried something like this and is it even possible to copy the file and use it in the way i would like to?

Thanks in advance.

User avatar
joan
Posts: 14259
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO access with assembly using QEMU

Sun May 26, 2019 5:32 pm

Do you mean /dev/gpiomem? That is a Linux device and there is no assembler equivalent as far as I know.

fenriswolf24
Posts: 2
Joined: Sun May 26, 2019 8:50 am
Location: Germany

Re: GPIO access with assembly using QEMU

Mon May 27, 2019 8:08 am

Yes, that's what i meant. AFAIK this device is some kind of memory mapping or even a memory mirror. If you usw assembler while running raspian, you basically map your registers with this device. So i don't need an assembler equivalent, i need a way to either map my memory without this device, or copy the whole device into my emulator. But i'm not sure, If this ist possible on a Raspberry running Raspian.

Return to “Raspbian”