3 ms·
I did something like that the first time I had to write a device driver, but I did it kind of stupidly. It was in college and I had a part time job doing doing
by tzs 2y ago
I did something like that the first time I had to write a device driver, but I did it kind of stupidly.
It was in college and I had a part time job doing doing system administration and programming for the high energy physics department. They had an RX02 8" floppy drive that they wanted to use on their VAX 11/780 which was running Unix/32V and I was assigned to write the driver.
I basically started with a C file that just had empty functions for all the functions that I knew Unix expected a driver to have, and then started filling those functions with comments recording what I had figured out that they had to do.
Each started with just a few high level comments. Then I'd add more comments breaking those down, and so on, until I finally had all the information I'd need in there and could start coding.
That's when I then did something stupid. As I started implementing the things the comments described I replaced the comments with the code.
I got about half way through before I realized that I should adding the code below the comments rather than replacing the comments.