Skip to content
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 block virtio driver #158

Closed
MatiasVara opened this Issue Feb 4, 2018 · 8 comments

Comments

Projects
None yet
1 participant
@MatiasVara
Copy link
Collaborator

MatiasVara commented Feb 4, 2018

No description provided.

@MatiasVara MatiasVara added the feature label Feb 4, 2018

@MatiasVara

This comment has been minimized.

Copy link
Collaborator Author

MatiasVara commented Feb 4, 2018

Some code can be reused from the virtio network driver.

@MatiasVara

This comment has been minimized.

Copy link
Collaborator Author

MatiasVara commented Apr 4, 2018

I should do first #154

@MatiasVara

This comment has been minimized.

Copy link
Collaborator Author

MatiasVara commented Dec 2, 2018

To start with this issues asap.

@MatiasVara MatiasVara self-assigned this Dec 2, 2018

@MatiasVara

This comment has been minimized.

Copy link
Collaborator Author

MatiasVara commented Jan 28, 2019

I have already started with this.

@MatiasVara

This comment has been minimized.

Copy link
Collaborator Author

MatiasVara commented Jan 28, 2019

The device has only one queue. Each request is a struct like:

struct virtio_blk_req { 
        le32 type; 
        le32 reserved; 
        le64 sector; 
        u8 data[][512]; 
        u8 status; 
}; 

The type of the request is either a read (VIRTIO_BLK_T_IN=1) or a write (VIRTIO_BLK_T_OUT=0). There are more but I am only interested on those.

@MatiasVara

This comment has been minimized.

Copy link
Collaborator Author

MatiasVara commented Jan 28, 2019

Note: Since the BlockRequest structure contains both read-only and write-only fields, it may be necessary to split this structure up into multiple buffers. The Type, Priority and Sector fields should be placed in a Read-Only buffer, and the Data and Status fields should be placed in a Write-Only buffer. The buffers will need to be linked together using the Next field. For Write requests, the buffer containing the Data field should be Read-Only, and the Status field buffer should be Write-Only, which would require 3 buffer entries.

@MatiasVara

This comment has been minimized.

Copy link
Collaborator Author

MatiasVara commented Feb 24, 2019

I add the first commit of the virtio blockdriver. Current issue is the partition scheme. I am thinking to just provide 4 possibles minor numbers to refer to 1st, 2nd, 3rd and 4th partition.

@MatiasVara

This comment has been minimized.

Copy link
Collaborator Author

MatiasVara commented Mar 5, 2019

This is ready to be merged to master.

MatiasVara added a commit that referenced this issue Mar 5, 2019

Issue #158: Add driver for virtio block devices
This commit adds the virtio driver for block devices.

@MatiasVara MatiasVara closed this Mar 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.