PeachOS icon indicating copy to clipboard operation
PeachOS copied to clipboard

fopen error message issue

Open tom8907 opened this issue 1 year ago • 3 comments

Error messages in fat16_open

There is a problem with an error message returned from fat16_open. It shows up when trying to run a program from the shell and forgetting to add the file extension. In my case it was meminfo.elf, but I entered meminfo. After the call to fat16_get_directory_entry, the error is EIO, but shouldn't this be a EINVARG instead, since every function called from here is dealing with the file name?

Secondly, when this error filters back up to elf_load which made the initial fopen call, it then changes any error messages that are received to EIO. Granted the error handling isn't really dealt with in detail in the course, but I thought I would at least mention it to you.

Really enjoyed the course, and I am waiting for part 2.

Thanks, Tom Bonesteel

tom8907 avatar Dec 16 '24 20:12 tom8907

Hello tom, You are correct, this wont be corrected in this repository due to the part two course already being started and the code has to flow correctly to ensure consistancy between the courses. I will fix this in the part two course, the issue will remain open for anyone who prefers to use the correct code.

This is not a bug as such but a correction, a valid correction as people do expect the correct convention

Thanks Dan

nibblebits avatar Dec 23 '24 10:12 nibblebits

Part two is coming in 6-12 months, keep an eye on the newsletters :)

nibblebits avatar Dec 23 '24 10:12 nibblebits

Just to let you know this course part two is available now https://dragonzap.com/course/developing-a-multithreaded-kernel-from-scratch-part-two-module-one

nibblebits avatar Oct 09 '25 22:10 nibblebits