XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
main.cpp File Reference
#include <aurora.h>
#include <Drivers/usb.h>
#include <Mm/kmalloc.h>
#include <Mm/pmmngr.h>
#include <aucon.h>
#include <Fs/vdisk.h>
#include <Hal/serial.h>
#include <stdio.h>
Include dependency graph for main.cpp:

Classes

struct  _scsi_cmd_
 
struct  _scsi_status_
 
struct  _scsi_inquiry_resp_
 
struct  _scsi_read_capacity_
 
struct  _scsi_capacity_resp_
 
struct  _scsi_read_10_
 
struct  _scsi_write_10_
 

Macros

#define SCSI_CMD_BLK_SIGNATURE   0x43425355
 
#define SCSI_CMD_FLAG_INPUT   0x80
 
#define SCSI_CMD_FLAG_OUTPUT   0x00
 
#define SCSI_CMD_STATUS_SIGNATURE   0x53425355
 
#define SCSI_STATUS_FAILED   1
 
#define SCSI_STATUS_PHASE_ERR   2
 

Typedefs

typedef struct _scsi_cmd_ SCSICommand
 
typedef struct _scsi_status_ SCSIStatus
 
typedef struct _scsi_inquiry_resp_ SCSIInquiryResponse
 
typedef struct _scsi_read_capacity_ SCSIReadCapacity
 
typedef struct _scsi_capacity_resp_ SCSICapacityResponse
 
typedef struct _scsi_read_10_ SCSIRead10
 
typedef struct _scsi_write_10_ SCSIWrite10
 

Functions

AU_EXTERN AU_EXPORT int AuDriverUnload (AuUSBDeviceStruc *dev)
 
void AuUSBMSCSendCommand (AuUSBDeviceStruc *dev, void *bulkIn, void *bulkOut, SCSICommand *cbw, void *resp, uint32_t respSize)
 
uint32_t convEndian (uint32_t value)
 
uint32_t cpuBe32 (uint32_t value)
 
void AuUSBMSCRead (AuUSBDeviceStruc *dev, uint32_t lba, uint16_t numBlocks, uint32_t blockSz, uint64_t *buffer)
 
void AuUSBMSCWrite (AuUSBDeviceStruc *dev, uint32_t lba, uint16_t numBlocks, uint32_t blockSz, uint64_t *buffer)
 
int AuUSBVDiskRead (AuVDisk *disk, uint64_t lba, uint32_t count, uint64_t *buffer)
 
int AuUSBVDiskWrite (AuVDisk *disk, uint64_t lba, uint32_t count, uint64_t *buffer)
 
AU_EXTERN AU_EXPORT int AuUSBDriverMain (AuUSBDeviceStruc *dev)
 

Variables

void * bulkIn
 
void * bulkOut
 
int _fltused = 1
 

Macro Definition Documentation

◆ SCSI_CMD_BLK_SIGNATURE

#define SCSI_CMD_BLK_SIGNATURE   0x43425355

BSD 2-Clause License

Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

◆ SCSI_CMD_FLAG_INPUT

#define SCSI_CMD_FLAG_INPUT   0x80

◆ SCSI_CMD_FLAG_OUTPUT

#define SCSI_CMD_FLAG_OUTPUT   0x00

◆ SCSI_CMD_STATUS_SIGNATURE

#define SCSI_CMD_STATUS_SIGNATURE   0x53425355

◆ SCSI_STATUS_FAILED

#define SCSI_STATUS_FAILED   1

◆ SCSI_STATUS_PHASE_ERR

#define SCSI_STATUS_PHASE_ERR   2

Typedef Documentation

◆ SCSICapacityResponse

◆ SCSICommand

typedef struct _scsi_cmd_ SCSICommand

◆ SCSIInquiryResponse

◆ SCSIRead10

typedef struct _scsi_read_10_ SCSIRead10

◆ SCSIReadCapacity

◆ SCSIStatus

typedef struct _scsi_status_ SCSIStatus

◆ SCSIWrite10

typedef struct _scsi_write_10_ SCSIWrite10

Function Documentation

◆ AuDriverUnload()

AU_EXTERN AU_EXPORT int AuDriverUnload ( AuUSBDeviceStruc dev)

◆ AuUSBDriverMain()

AU_EXTERN AU_EXPORT int AuUSBDriverMain ( AuUSBDeviceStruc dev)

◆ AuUSBMSCRead()

void AuUSBMSCRead ( AuUSBDeviceStruc dev,
uint32_t  lba,
uint16_t  numBlocks,
uint32_t  blockSz,
uint64_t buffer 
)

◆ AuUSBMSCSendCommand()

void AuUSBMSCSendCommand ( AuUSBDeviceStruc dev,
void *  bulkIn,
void *  bulkOut,
SCSICommand cbw,
void *  resp,
uint32_t  respSize 
)

◆ AuUSBMSCWrite()

void AuUSBMSCWrite ( AuUSBDeviceStruc dev,
uint32_t  lba,
uint16_t  numBlocks,
uint32_t  blockSz,
uint64_t buffer 
)

◆ AuUSBVDiskRead()

int AuUSBVDiskRead ( AuVDisk disk,
uint64_t  lba,
uint32_t  count,
uint64_t buffer 
)

◆ AuUSBVDiskWrite()

int AuUSBVDiskWrite ( AuVDisk disk,
uint64_t  lba,
uint32_t  count,
uint64_t buffer 
)

◆ convEndian()

uint32_t convEndian ( uint32_t  value)

◆ cpuBe32()

uint32_t cpuBe32 ( uint32_t  value)

Variable Documentation

◆ _fltused

int _fltused = 1

◆ bulkIn

void* bulkIn

◆ bulkOut

void* bulkOut