mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-26 09:02:46 +00:00
feat(drivers): Implement Bochs VBE display adapter, VirtIO-Blk, VirtIO-Net, VirtIO-RNG, and HWMON CoreTemp sensors + 'sensors' CLI utility
This commit is contained in:
1 parent
cfc122dda6
commit
7c620e86e7
14 files changed
+466
-1
No files matched your search
@@ -0,0 +1,33 @@
|
||||
#ifndef _DRIVERS_VIRTIO_BLK_H
|
||||
#define _DRIVERS_VIRTIO_BLK_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define VIRTIO_BLK_T_IN 0
|
||||
#define VIRTIO_BLK_T_OUT 1
|
||||
#define VIRTIO_BLK_T_FLUSH 4
|
||||
#define VIRTIO_BLK_T_GET_ID 8
|
||||
|
||||
typedef struct {
|
||||
uint32_t type;
|
||||
uint32_t reserved;
|
||||
uint64_t sector;
|
||||
} __attribute__((packed)) virtio_blk_req_header_t;
|
||||
|
||||
typedef struct {
|
||||
char serial[20];
|
||||
uint64_t capacity_sectors;
|
||||
uint32_t blk_size;
|
||||
uint16_t queue_size;
|
||||
bool initialized;
|
||||
} virtio_blk_info_t;
|
||||
|
||||
bool virtio_blk_init(void);
|
||||
bool virtio_blk_is_detected(void);
|
||||
const virtio_blk_info_t* virtio_blk_get_info(void);
|
||||
int virtio_blk_read(uint64_t sector, uint32_t count, void* buffer);
|
||||
int virtio_blk_write(uint64_t sector, uint32_t count, const void* buffer);
|
||||
|
||||
#endif // _DRIVERS_VIRTIO_BLK_H
|
||||
Reference in new issue
Block a user