Commit Graph

12 Commits

Author SHA1 Message Date
Anhad Singh eee780fa0f virtiod: split into virtio-core and virtiod
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-27 09:51:16 +10:00
Anhad Singh ea1c855cdc virtiod: make use of the int_roundings feature
* Removes the need to define `round_up` and `div_round_up`

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-26 09:55:48 +10:00
Anhad Singh 65c4317564 virtiod: refactoring
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-23 16:18:14 +10:00
Anhad Singh c176903905 virtio-blk: read and scheme
* Minor code cleanup
* Able to read/write from the disk
* Recycle the descriptors (this is currently done inefficiently, will be
  fixed in a follow up commit)
* Add the disk scheme for virtio-blk with working functionality for seek(),
  read() and open()
* After all of this work, we are successfully able to boot redox from
  virtio-blk!! :)

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-23 12:41:07 +10:00
Anhad Singh 576302a618 virtio-blk: get device config
* Get the device config for virtio-blk
* Log out the # sectors and the block size

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-20 14:17:31 +10:00
Anhad Singh 8fb5e353ea virtio::transport: setup queue
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-20 14:14:22 +10:00
Anhad Singh 990a9c2716 virtio::transport: finalize features
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-20 10:14:10 +10:00
Anhad Singh 8a7fa569a7 virtiod: ensure the device has MSI-X support
According to the virtio sspecification v1.2, MSI-X support is REQUIRED
and is the only supported method anyways (i.e, legacy int and MSI wont
work).

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-20 10:00:08 +10:00
Anhad Singh 100ff9abd4 virtio: add check_device_feature and ack_driver_feature for
`StandardTransport`.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 16:33:00 +10:00
Anhad Singh 12551d450f virtio: enable and allocate MSI-X vector
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 15:12:44 +10:00
Anhad Singh f750d4223d virtio: perform the device reset
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 12:19:57 +10:00
Anhad Singh 1580cb8c83 virtio: stub!
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2023-06-19 12:02:35 +10:00