cu-ecen-aeld / final-project-acpabst

final-project-acpabst created by GitHub Classroom
0 stars 0 forks source link

aesdchar kernel driver update #4

Closed acpabst closed 3 months ago

acpabst commented 4 months ago

update aesdchar to have a clearing function such that the circular buffer does not have to be unloaded and reloaded each time the game restarts. Having to unload the driver and reload the driver when the game starts means that no other applications could safely use the driver! Could I use flush to do this? Maybe I need to use ioctl? https://www.oreilly.com/library/view/linux-device-drivers/0596000081/ch03s03.html

DoD Note that testing this can be done locally. After loading the new driver into the kernel, the following behavior is expected:

Summary Each of the two parts of the DoD are true I updated the Assigntment 3 repo (commit 16006ca) with the flushing functionality, and added testing infrastructure to test it. When running locally, the device continues to return what was written as normal, but when the ioctl is invoked, the device returns nothing because the data was flushed! Additionally, I added this to the custom raspberry pi image!

acpabst commented 3 months ago

Done with this! I used an additional ioctl command to implement a flush function in the aesdchar kernel driver. I could not figure out how to invoke an ioctl from the command line, so I wrote a small helper program in c to test it, and a script to run the test. I went an extra step and added this to my custom Linux image, and confirmed that the new ioctl worked locally and on the Raspberry Pi. Here is a picture of the completed test running on the Raspberry Pi! IMG_1213 Note that this corresponds to the following commit: f0f0b8d