-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add drive device #555
Add drive device #555
Conversation
With
And if we don't close the file handle we can read the subsequent blocks, for example in Lisp:
But there is currently no way to pass the context needed to the device to know which ATA bus and drive we want to read. In the current implementation we hardcoded the first drive of the first bus. Currently when we create a device we create a special dir entry, and then we write the number representing the device kind in the disk, so that when we later open a device we can get its kind by reading the file. We could do more than storing just a number in this file. We could also store the context there. |
We can now store specific device information when we create them that can be used when opening them. |
Currently |
Now that we can directly read a drive in userspace we could read its superblock if it exists to get the number of blocks available and the number of blocks used for And after implementing writes we could also stay in userspace for Finally for |
Example of Lisp code to read file:
|
This PR is not finished but it is already useful as it is so we can merge it and open another one to finish the work later. |
fs::DeviceType::Drive
FileIO::read
forata::Drive
FileIO::write
forata::Drive
/dev/ata/<bus>/<dsk>
to read the drive deviceSEEK
syscalldisk usage
command to read superblock from drive devicedisk erase
command to write 0 to the whole drive devicedisk format
to write 0 to the block bitmaps, create a new superblock, and create the root dirdisk list
to read more information from the drive device (name, size)