Powerview Compiles with develop merged (Wont work though)

This commit is contained in:
Tony Kuker 2023-02-03 23:31:32 -06:00
parent 428376d9c2
commit b86bf4b47a
8 changed files with 850 additions and 715 deletions

View File

@ -15,6 +15,7 @@
#include "scsi_printer.h"
#include "scsi_host_bridge.h"
#include "scsi_daynaport.h"
#include "scsi_powerview.h"
#include "host_services.h"
#include "device_factory.h"
#include <ifaddrs.h>
@ -64,6 +65,7 @@ DeviceFactory::DeviceFactory()
device_mapping["daynaport"] = SCDP;
device_mapping["printer"] = SCLP;
device_mapping["services"] = SCHS;
device_mapping["powerview"] = SCPV;
}
PbDeviceType DeviceFactory::GetTypeForFile(const string& filename) const
@ -151,6 +153,15 @@ shared_ptr<PrimaryDevice> DeviceFactory::CreateDevice(PbDeviceType type, int lun
device->SetDefaultParams(default_params.find(SCLP)->second);
break;
case SCPV:
device = make_shared<SCSIPowerView>(lun);
// Since this is an emulation for a specific device the full INQUIRY data have to be set accordingly
device->SetVendor("RADIUS ");
device->SetProduct("PowerView ");
device->SetRevision("V1.0");
device->SetDefaultParams(default_params.find(SCPV)->second);
break;
default:
break;
}

View File

@ -12,6 +12,7 @@
#pragma once
#include <vector>
#include <cstdint>
using namespace std;

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,8 @@
//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI (*^..^*)
// for Raspberry Pi
// SCSI Target Emulator PiSCSI for Raspberry Pi
//
// Copyright (C) 2020-2021 akuker
// Copyright (C) 2020-2023 akuker
// Copyright (C) 2020 joshua stein <jcs@jcs.org>
//
// Licensed under the BSD 3-Clause License.
@ -19,11 +18,11 @@
//---------------------------------------------------------------------------
#pragma once
#include "os.h"
#include "disk.h"
#include "interfaces/byte_writer.h"
#include "primary_device.h"
#include <map>
#include <string>
#include "../rascsi.h"
#include <linux/fb.h>
//===========================================================================
@ -31,24 +30,24 @@
// Radius PowerView
//
//===========================================================================
class SCSIPowerView: public Disk
class SCSIPowerView : public PrimaryDevice, public ByteWriter
{
private:
typedef struct _command_t {
const char* name;
void (SCSIPowerView::*execute)(SASIDEV *);
// typedef struct _command_t {
// const char* name;
// void (SCSIPowerView::*execute)(SASIDEV *);
_command_t(const char* _name, void (SCSIPowerView::*_execute)(SASIDEV *)) : name(_name), execute(_execute) { };
} command_t;
std::map<SCSIDEV::scsi_command, command_t*> commands;
// _command_t(const char* _name, void (SCSIPowerView::*_execute)(SASIDEV *)) : name(_name), execute(_execute) { };
// } command_t;
// std::map<SCSIDEV::scsi_command, command_t*> commands;
SASIDEV::ctrl_t *ctrl;
// SASIDEV::ctrl_t *ctrl;
enum eColorDepth_t : uint16_t {eColorsNone=0x0000, eColorsBW=0x0001, eColors16=0x0010, eColors256=0x0100};
void AddCommand(SCSIDEV::scsi_command, const char*, void (SCSIPowerView::*)(SASIDEV *));
// void AddCommand(SCSIDEV::scsi_command, const char*, void (SCSIPowerView::*)(SASIDEV *));
// Largest framebuffer supported by the Radius PowerView is 800x600 at 256 colors (1 bytes per pixel)
// Double it for now, because memory is cheap....
@ -57,32 +56,47 @@ private:
void fbcon_cursor(bool blank);
void fbcon_blank(bool blank);
void fbcon_text(char* message);
void fbcon_text(const char* message);
public:
SCSIPowerView();
~SCSIPowerView();
bool Init(const map<string, string>&) override;
explicit SCSIPowerView(int);
~SCSIPowerView() override;
bool Init(const unordered_map<string, string>&) override;
bool HwInit();
// Commands
vector<uint8_t> InquiryInternal() const override;
// int Read(const vector<int>&, vector<uint8_t>&, uint64_t);
bool WriteBytes(const vector<int>&, vector<uint8_t>&, uint32_t) override;
// int RetrieveStats(const vector<int>&, vector<uint8_t>&) const;
// void TestUnitReady() override;
// void Read6();
// void Write6() const;
// // Commands
int Inquiry(const DWORD *cdb, BYTE *buffer) override;
bool WriteFrameBuffer(const DWORD *cdb, const BYTE *buf, const DWORD length);
bool WriteColorPalette(const DWORD *cdb, const BYTE *buf, const DWORD length);
bool WriteConfiguration(const DWORD *cdb, const BYTE *buf, const DWORD length);
bool WriteUnknownCC(const DWORD *cdb, const BYTE *buf, const DWORD length);
// old..... int Inquiry(const uint32_t *cdb, uint8_t *buffer) override;
bool WriteFrameBuffer();
bool WriteColorPalette();
bool WriteConfiguration();
bool WriteUnknownCC();
void CmdReadConfig(SASIDEV *controller);
void CmdWriteConfig(SASIDEV *controller);
void CmdWriteFramebuffer(SASIDEV *controller);
void CmdWriteColorPalette(SASIDEV *controller);
void UnknownCommandCC(SASIDEV *controller);
bool Dispatch(SCSIDEV *) override;
void CmdReadConfig();
void CmdWriteConfig();
void CmdWriteFramebuffer();
void CmdWriteColorPalette();
void UnknownCommandCC();
private:
void ClearFrameBuffer(DWORD blank_color);
void ClearFrameBuffer(uint32_t blank_color);
// Default to the lowest resolution supported by the PowerView (640x400)
uint32_t screen_width_px = 640;
@ -93,15 +107,15 @@ private:
struct fb_fix_screeninfo fbfixinfo;
// The maximum color depth is 16 bits
BYTE color_palette[0x10000];
int color_palette_length = 0;
uint8_t color_palette[0x10000];
// int color_palette_length = 0;
BYTE unknown_cc_data[0x10000];
uint8_t unknown_cc_data[0x10000];
int unknown_cc_data_length = 0;
static const BYTE default_color_palette_bw[8];
static const BYTE default_color_palette_16[64];
static const BYTE default_color_palette_256[1024];
static const uint8_t default_color_palette_bw[8];
static const uint8_t default_color_palette_16[64];
static const uint8_t default_color_palette_256[1024];
int fbfd;
char *fb;
@ -109,12 +123,12 @@ private:
int fbbpp;
// Hard-coded inquiry response to match the real PowerView
static const BYTE m_inquiry_response[];
static const uint8_t m_inquiry_response[];
static unsigned char reverse_table[256];
DWORD framebuffer_black;
DWORD framebuffer_blue;
DWORD framebuffer_yellow;
DWORD framebuffer_red;
uint32_t framebuffer_black;
uint32_t framebuffer_blue;
uint32_t framebuffer_yellow;
uint32_t framebuffer_red;
};

View File

@ -1,11 +1,10 @@
//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI (*^..^*)
// for Raspberry Pi
// SCSI Target Emulator PiSCSI for Raspberry Pi
//
// Copyright (C) 2021 akuker
// Copyright (C) 2021-2023 akuker
//
// Licensed under the BSD 3-Clause License.
// Licensed under the BSD 3-Clause License.
// See LICENSE file in the project root folder.
//
// [ Default color palettes for the Radius PowerView SCSI Display Adapter ]
@ -13,83 +12,71 @@
//---------------------------------------------------------------------------
#include "scsi_powerview.h"
#include <cstdint>
const BYTE SCSIPowerView::default_color_palette_bw[8] = {
0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF
const uint8_t SCSIPowerView::default_color_palette_bw[8] = {0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
const uint8_t SCSIPowerView::default_color_palette_16[64] = {
0x00, 0xFF, 0xFF, 0xFF, 0x01, 0xFC, 0xF3, 0x05, 0x02, 0xFF, 0x64, 0x02, 0x03, 0xDD, 0x08, 0x06,
0x04, 0xF2, 0x08, 0x84, 0x05, 0x46, 0x00, 0xA5, 0x06, 0x00, 0x00, 0xD4, 0x07, 0x02, 0xAB, 0xEA,
0x08, 0x1F, 0xB7, 0x14, 0x09, 0x00, 0x64, 0x11, 0x0A, 0x56, 0x2C, 0x05, 0x0B, 0x90, 0x71, 0x3A,
0x0C, 0xC0, 0xC0, 0xC0, 0x0D, 0x80, 0x80, 0x80, 0x0E, 0x20, 0x20, 0x20, 0x0F, 0x00, 0x00, 0x00,
};
const BYTE SCSIPowerView::default_color_palette_16[64] = {
0x00, 0xFF, 0xFF, 0xFF, 0x01, 0xFC, 0xF3, 0x05, 0x02, 0xFF, 0x64, 0x02, 0x03, 0xDD, 0x08, 0x06,
0x04, 0xF2, 0x08, 0x84, 0x05, 0x46, 0x00, 0xA5, 0x06, 0x00, 0x00, 0xD4, 0x07, 0x02, 0xAB, 0xEA,
0x08, 0x1F, 0xB7, 0x14, 0x09, 0x00, 0x64, 0x11, 0x0A, 0x56, 0x2C, 0x05, 0x0B, 0x90, 0x71, 0x3A,
0x0C, 0xC0, 0xC0, 0xC0, 0x0D, 0x80, 0x80, 0x80, 0x0E, 0x20, 0x20, 0x20, 0x0F, 0x00, 0x00, 0x00,
};
const uint8_t SCSIPowerView::default_color_palette_256[1024] = {
const BYTE SCSIPowerView::default_color_palette_256[1024] = {
0x00, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xCC, 0x02, 0xFF, 0xFF, 0x99, 0x03, 0xFF, 0xFF, 0x66,
0x04, 0xFF, 0xFF, 0x33, 0x05, 0xFF, 0xFF, 0x00, 0x06, 0xFF, 0xCC, 0xFF, 0x07, 0xFF, 0xCC, 0xCC,
0x08, 0xFF, 0xCC, 0x99, 0x09, 0xFF, 0xCC, 0x66, 0x0A, 0xFF, 0xCC, 0x33, 0x0B, 0xFF, 0xCC, 0x00,
0x0C, 0xFF, 0x99, 0xFF, 0x0D, 0xFF, 0x99, 0xCC, 0x0E, 0xFF, 0x99, 0x99, 0x0F, 0xFF, 0x99, 0x66,
0x10, 0xFF, 0x99, 0x33, 0x11, 0xFF, 0x99, 0x00, 0x12, 0xFF, 0x66, 0xFF, 0x13, 0xFF, 0x66, 0xCC,
0x14, 0xFF, 0x66, 0x99, 0x15, 0xFF, 0x66, 0x66, 0x16, 0xFF, 0x66, 0x33, 0x17, 0xFF, 0x66, 0x00,
0x18, 0xFF, 0x33, 0xFF, 0x19, 0xFF, 0x33, 0xCC, 0x1A, 0xFF, 0x33, 0x99, 0x1B, 0xFF, 0x33, 0x66,
0x1C, 0xFF, 0x33, 0x33, 0x1D, 0xFF, 0x33, 0x00, 0x1E, 0xFF, 0x00, 0xFF, 0x1F, 0xFF, 0x00, 0xCC,
0x20, 0xFF, 0x00, 0x99, 0x21, 0xFF, 0x00, 0x66, 0x22, 0xFF, 0x00, 0x33, 0x23, 0xFF, 0x00, 0x00,
0x24, 0xCC, 0xFF, 0xFF, 0x25, 0xCC, 0xFF, 0xCC, 0x26, 0xCC, 0xFF, 0x99, 0x27, 0xCC, 0xFF, 0x66,
0x28, 0xCC, 0xFF, 0x33, 0x29, 0xCC, 0xFF, 0x00, 0x2A, 0xCC, 0xCC, 0xFF, 0x2B, 0xCC, 0xCC, 0xCC,
0x2C, 0xCC, 0xCC, 0x99, 0x2D, 0xCC, 0xCC, 0x66, 0x2E, 0xCC, 0xCC, 0x33, 0x2F, 0xCC, 0xCC, 0x00,
0x30, 0xCC, 0x99, 0xFF, 0x31, 0xCC, 0x99, 0xCC, 0x32, 0xCC, 0x99, 0x99, 0x33, 0xCC, 0x99, 0x66,
0x34, 0xCC, 0x99, 0x33, 0x35, 0xCC, 0x99, 0x00, 0x36, 0xCC, 0x66, 0xFF, 0x37, 0xCC, 0x66, 0xCC,
0x38, 0xCC, 0x66, 0x99, 0x39, 0xCC, 0x66, 0x66, 0x3A, 0xCC, 0x66, 0x33, 0x3B, 0xCC, 0x66, 0x00,
0x3C, 0xCC, 0x33, 0xFF, 0x3D, 0xCC, 0x33, 0xCC, 0x3E, 0xCC, 0x33, 0x99, 0x3F, 0xCC, 0x33, 0x66,
0x40, 0xCC, 0x33, 0x33, 0x41, 0xCC, 0x33, 0x00, 0x42, 0xCC, 0x00, 0xFF, 0x43, 0xCC, 0x00, 0xCC,
0x44, 0xCC, 0x00, 0x99, 0x45, 0xCC, 0x00, 0x66, 0x46, 0xCC, 0x00, 0x33, 0x47, 0xCC, 0x00, 0x00,
0x48, 0x99, 0xFF, 0xFF, 0x49, 0x99, 0xFF, 0xCC, 0x4A, 0x99, 0xFF, 0x99, 0x4B, 0x99, 0xFF, 0x66,
0x4C, 0x99, 0xFF, 0x33, 0x4D, 0x99, 0xFF, 0x00, 0x4E, 0x99, 0xCC, 0xFF, 0x4F, 0x99, 0xCC, 0xCC,
0x50, 0x99, 0xCC, 0x99, 0x51, 0x99, 0xCC, 0x66, 0x52, 0x99, 0xCC, 0x33, 0x53, 0x99, 0xCC, 0x00,
0x54, 0x99, 0x99, 0xFF, 0x55, 0x99, 0x99, 0xCC, 0x56, 0x99, 0x99, 0x99, 0x57, 0x99, 0x99, 0x66,
0x58, 0x99, 0x99, 0x33, 0x59, 0x99, 0x99, 0x00, 0x5A, 0x99, 0x66, 0xFF, 0x5B, 0x99, 0x66, 0xCC,
0x5C, 0x99, 0x66, 0x99, 0x5D, 0x99, 0x66, 0x66, 0x5E, 0x99, 0x66, 0x33, 0x5F, 0x99, 0x66, 0x00,
0x60, 0x99, 0x33, 0xFF, 0x61, 0x99, 0x33, 0xCC, 0x62, 0x99, 0x33, 0x99, 0x63, 0x99, 0x33, 0x66,
0x64, 0x99, 0x33, 0x33, 0x65, 0x99, 0x33, 0x00, 0x66, 0x99, 0x00, 0xFF, 0x67, 0x99, 0x00, 0xCC,
0x68, 0x99, 0x00, 0x99, 0x69, 0x99, 0x00, 0x66, 0x6A, 0x99, 0x00, 0x33, 0x6B, 0x99, 0x00, 0x00,
0x6C, 0x66, 0xFF, 0xFF, 0x6D, 0x66, 0xFF, 0xCC, 0x6E, 0x66, 0xFF, 0x99, 0x6F, 0x66, 0xFF, 0x66,
0x70, 0x66, 0xFF, 0x33, 0x71, 0x66, 0xFF, 0x00, 0x72, 0x66, 0xCC, 0xFF, 0x73, 0x66, 0xCC, 0xCC,
0x74, 0x66, 0xCC, 0x99, 0x75, 0x66, 0xCC, 0x66, 0x76, 0x66, 0xCC, 0x33, 0x77, 0x66, 0xCC, 0x00,
0x78, 0x66, 0x99, 0xFF, 0x79, 0x66, 0x99, 0xCC, 0x7A, 0x66, 0x99, 0x99, 0x7B, 0x66, 0x99, 0x66,
0x7C, 0x66, 0x99, 0x33, 0x7D, 0x66, 0x99, 0x00, 0x7E, 0x66, 0x66, 0xFF, 0x7F, 0x66, 0x66, 0xCC,
0x80, 0x66, 0x66, 0x99, 0x81, 0x66, 0x66, 0x66, 0x82, 0x66, 0x66, 0x33, 0x83, 0x66, 0x66, 0x00,
0x84, 0x66, 0x33, 0xFF, 0x85, 0x66, 0x33, 0xCC, 0x86, 0x66, 0x33, 0x99, 0x87, 0x66, 0x33, 0x66,
0x88, 0x66, 0x33, 0x33, 0x89, 0x66, 0x33, 0x00, 0x8A, 0x66, 0x00, 0xFF, 0x8B, 0x66, 0x00, 0xCC,
0x8C, 0x66, 0x00, 0x99, 0x8D, 0x66, 0x00, 0x66, 0x8E, 0x66, 0x00, 0x33, 0x8F, 0x66, 0x00, 0x00,
0x90, 0x33, 0xFF, 0xFF, 0x91, 0x33, 0xFF, 0xCC, 0x92, 0x33, 0xFF, 0x99, 0x93, 0x33, 0xFF, 0x66,
0x94, 0x33, 0xFF, 0x33, 0x95, 0x33, 0xFF, 0x00, 0x96, 0x33, 0xCC, 0xFF, 0x97, 0x33, 0xCC, 0xCC,
0x98, 0x33, 0xCC, 0x99, 0x99, 0x33, 0xCC, 0x66, 0x9A, 0x33, 0xCC, 0x33, 0x9B, 0x33, 0xCC, 0x00,
0x9C, 0x33, 0x99, 0xFF, 0x9D, 0x33, 0x99, 0xCC, 0x9E, 0x33, 0x99, 0x99, 0x9F, 0x33, 0x99, 0x66,
0xA0, 0x33, 0x99, 0x33, 0xA1, 0x33, 0x99, 0x00, 0xA2, 0x33, 0x66, 0xFF, 0xA3, 0x33, 0x66, 0xCC,
0xA4, 0x33, 0x66, 0x99, 0xA5, 0x33, 0x66, 0x66, 0xA6, 0x33, 0x66, 0x33, 0xA7, 0x33, 0x66, 0x00,
0xA8, 0x33, 0x33, 0xFF, 0xA9, 0x33, 0x33, 0xCC, 0xAA, 0x33, 0x33, 0x99, 0xAB, 0x33, 0x33, 0x66,
0xAC, 0x33, 0x33, 0x33, 0xAD, 0x33, 0x33, 0x00, 0xAE, 0x33, 0x00, 0xFF, 0xAF, 0x33, 0x00, 0xCC,
0xB0, 0x33, 0x00, 0x99, 0xB1, 0x33, 0x00, 0x66, 0xB2, 0x33, 0x00, 0x33, 0xB3, 0x33, 0x00, 0x00,
0xB4, 0x00, 0xFF, 0xFF, 0xB5, 0x00, 0xFF, 0xCC, 0xB6, 0x00, 0xFF, 0x99, 0xB7, 0x00, 0xFF, 0x66,
0xB8, 0x00, 0xFF, 0x33, 0xB9, 0x00, 0xFF, 0x00, 0xBA, 0x00, 0xCC, 0xFF, 0xBB, 0x00, 0xCC, 0xCC,
0xBC, 0x00, 0xCC, 0x99, 0xBD, 0x00, 0xCC, 0x66, 0xBE, 0x00, 0xCC, 0x33, 0xBF, 0x00, 0xCC, 0x00,
0xC0, 0x00, 0x99, 0xFF, 0xC1, 0x00, 0x99, 0xCC, 0xC2, 0x00, 0x99, 0x99, 0xC3, 0x00, 0x99, 0x66,
0xC4, 0x00, 0x99, 0x33, 0xC5, 0x00, 0x99, 0x00, 0xC6, 0x00, 0x66, 0xFF, 0xC7, 0x00, 0x66, 0xCC,
0xC8, 0x00, 0x66, 0x99, 0xC9, 0x00, 0x66, 0x66, 0xCA, 0x00, 0x66, 0x33, 0xCB, 0x00, 0x66, 0x00,
0xCC, 0x00, 0x33, 0xFF, 0xCD, 0x00, 0x33, 0xCC, 0xCE, 0x00, 0x33, 0x99, 0xCF, 0x00, 0x33, 0x66,
0xD0, 0x00, 0x33, 0x33, 0xD1, 0x00, 0x33, 0x00, 0xD2, 0x00, 0x00, 0xFF, 0xD3, 0x00, 0x00, 0xCC,
0xD4, 0x00, 0x00, 0x99, 0xD5, 0x00, 0x00, 0x66, 0xD6, 0x00, 0x00, 0x33, 0xD7, 0xEE, 0x00, 0x00,
0xD8, 0xDD, 0x00, 0x00, 0xD9, 0xBB, 0x00, 0x00, 0xDA, 0xAA, 0x00, 0x00, 0xDB, 0x88, 0x00, 0x00,
0xDC, 0x77, 0x00, 0x00, 0xDD, 0x55, 0x00, 0x00, 0xDE, 0x44, 0x00, 0x00, 0xDF, 0x22, 0x00, 0x00,
0xE0, 0x11, 0x00, 0x00, 0xE1, 0x00, 0xEE, 0x00, 0xE2, 0x00, 0xDD, 0x00, 0xE3, 0x00, 0xBB, 0x00,
0xE4, 0x00, 0xAA, 0x00, 0xE5, 0x00, 0x88, 0x00, 0xE6, 0x00, 0x77, 0x00, 0xE7, 0x00, 0x55, 0x00,
0xE8, 0x00, 0x44, 0x00, 0xE9, 0x00, 0x22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x47,
0xCC, 0x00, 0x00, 0x48, 0x99, 0xFF, 0xFF, 0x49, 0x99, 0xFF, 0xCC, 0x4A, 0x99, 0xFF, 0x99, 0x4B, 0x99, 0xFF, 0x66,
0x4C, 0x99, 0xFF, 0x33, 0x4D, 0x99, 0xFF, 0x00, 0x4E, 0x99, 0xCC, 0xFF, 0x4F, 0x99, 0xCC, 0xCC, 0x50, 0x99, 0xCC,
0x99, 0x51, 0x99, 0xCC, 0x66, 0x52, 0x99, 0xCC, 0x33, 0x53, 0x99, 0xCC, 0x00, 0x54, 0x99, 0x99, 0xFF, 0x55, 0x99,
0x99, 0xCC, 0x56, 0x99, 0x99, 0x99, 0x57, 0x99, 0x99, 0x66, 0x58, 0x99, 0x99, 0x33, 0x59, 0x99, 0x99, 0x00, 0x5A,
0x99, 0x66, 0xFF, 0x5B, 0x99, 0x66, 0xCC, 0x5C, 0x99, 0x66, 0x99, 0x5D, 0x99, 0x66, 0x66, 0x5E, 0x99, 0x66, 0x33,
0x5F, 0x99, 0x66, 0x00, 0x60, 0x99, 0x33, 0xFF, 0x61, 0x99, 0x33, 0xCC, 0x62, 0x99, 0x33, 0x99, 0x63, 0x99, 0x33,
0x66, 0x64, 0x99, 0x33, 0x33, 0x65, 0x99, 0x33, 0x00, 0x66, 0x99, 0x00, 0xFF, 0x67, 0x99, 0x00, 0xCC, 0x68, 0x99,
0x00, 0x99, 0x69, 0x99, 0x00, 0x66, 0x6A, 0x99, 0x00, 0x33, 0x6B, 0x99, 0x00, 0x00, 0x6C, 0x66, 0xFF, 0xFF, 0x6D,
0x66, 0xFF, 0xCC, 0x6E, 0x66, 0xFF, 0x99, 0x6F, 0x66, 0xFF, 0x66, 0x70, 0x66, 0xFF, 0x33, 0x71, 0x66, 0xFF, 0x00,
0x72, 0x66, 0xCC, 0xFF, 0x73, 0x66, 0xCC, 0xCC, 0x74, 0x66, 0xCC, 0x99, 0x75, 0x66, 0xCC, 0x66, 0x76, 0x66, 0xCC,
0x33, 0x77, 0x66, 0xCC, 0x00, 0x78, 0x66, 0x99, 0xFF, 0x79, 0x66, 0x99, 0xCC, 0x7A, 0x66, 0x99, 0x99, 0x7B, 0x66,
0x99, 0x66, 0x7C, 0x66, 0x99, 0x33, 0x7D, 0x66, 0x99, 0x00, 0x7E, 0x66, 0x66, 0xFF, 0x7F, 0x66, 0x66, 0xCC, 0x80,
0x66, 0x66, 0x99, 0x81, 0x66, 0x66, 0x66, 0x82, 0x66, 0x66, 0x33, 0x83, 0x66, 0x66, 0x00, 0x84, 0x66, 0x33, 0xFF,
0x85, 0x66, 0x33, 0xCC, 0x86, 0x66, 0x33, 0x99, 0x87, 0x66, 0x33, 0x66, 0x88, 0x66, 0x33, 0x33, 0x89, 0x66, 0x33,
0x00, 0x8A, 0x66, 0x00, 0xFF, 0x8B, 0x66, 0x00, 0xCC, 0x8C, 0x66, 0x00, 0x99, 0x8D, 0x66, 0x00, 0x66, 0x8E, 0x66,
0x00, 0x33, 0x8F, 0x66, 0x00, 0x00, 0x90, 0x33, 0xFF, 0xFF, 0x91, 0x33, 0xFF, 0xCC, 0x92, 0x33, 0xFF, 0x99, 0x93,
0x33, 0xFF, 0x66, 0x94, 0x33, 0xFF, 0x33, 0x95, 0x33, 0xFF, 0x00, 0x96, 0x33, 0xCC, 0xFF, 0x97, 0x33, 0xCC, 0xCC,
0x98, 0x33, 0xCC, 0x99, 0x99, 0x33, 0xCC, 0x66, 0x9A, 0x33, 0xCC, 0x33, 0x9B, 0x33, 0xCC, 0x00, 0x9C, 0x33, 0x99,
0xFF, 0x9D, 0x33, 0x99, 0xCC, 0x9E, 0x33, 0x99, 0x99, 0x9F, 0x33, 0x99, 0x66, 0xA0, 0x33, 0x99, 0x33, 0xA1, 0x33,
0x99, 0x00, 0xA2, 0x33, 0x66, 0xFF, 0xA3, 0x33, 0x66, 0xCC, 0xA4, 0x33, 0x66, 0x99, 0xA5, 0x33, 0x66, 0x66, 0xA6,
0x33, 0x66, 0x33, 0xA7, 0x33, 0x66, 0x00, 0xA8, 0x33, 0x33, 0xFF, 0xA9, 0x33, 0x33, 0xCC, 0xAA, 0x33, 0x33, 0x99,
0xAB, 0x33, 0x33, 0x66, 0xAC, 0x33, 0x33, 0x33, 0xAD, 0x33, 0x33, 0x00, 0xAE, 0x33, 0x00, 0xFF, 0xAF, 0x33, 0x00,
0xCC, 0xB0, 0x33, 0x00, 0x99, 0xB1, 0x33, 0x00, 0x66, 0xB2, 0x33, 0x00, 0x33, 0xB3, 0x33, 0x00, 0x00, 0xB4, 0x00,
0xFF, 0xFF, 0xB5, 0x00, 0xFF, 0xCC, 0xB6, 0x00, 0xFF, 0x99, 0xB7, 0x00, 0xFF, 0x66, 0xB8, 0x00, 0xFF, 0x33, 0xB9,
0x00, 0xFF, 0x00, 0xBA, 0x00, 0xCC, 0xFF, 0xBB, 0x00, 0xCC, 0xCC, 0xBC, 0x00, 0xCC, 0x99, 0xBD, 0x00, 0xCC, 0x66,
0xBE, 0x00, 0xCC, 0x33, 0xBF, 0x00, 0xCC, 0x00, 0xC0, 0x00, 0x99, 0xFF, 0xC1, 0x00, 0x99, 0xCC, 0xC2, 0x00, 0x99,
0x99, 0xC3, 0x00, 0x99, 0x66, 0xC4, 0x00, 0x99, 0x33, 0xC5, 0x00, 0x99, 0x00, 0xC6, 0x00, 0x66, 0xFF, 0xC7, 0x00,
0x66, 0xCC, 0xC8, 0x00, 0x66, 0x99, 0xC9, 0x00, 0x66, 0x66, 0xCA, 0x00, 0x66, 0x33, 0xCB, 0x00, 0x66, 0x00, 0xCC,
0x00, 0x33, 0xFF, 0xCD, 0x00, 0x33, 0xCC, 0xCE, 0x00, 0x33, 0x99, 0xCF, 0x00, 0x33, 0x66, 0xD0, 0x00, 0x33, 0x33,
0xD1, 0x00, 0x33, 0x00, 0xD2, 0x00, 0x00, 0xFF, 0xD3, 0x00, 0x00, 0xCC, 0xD4, 0x00, 0x00, 0x99, 0xD5, 0x00, 0x00,
0x66, 0xD6, 0x00, 0x00, 0x33, 0xD7, 0xEE, 0x00, 0x00, 0xD8, 0xDD, 0x00, 0x00, 0xD9, 0xBB, 0x00, 0x00, 0xDA, 0xAA,
0x00, 0x00, 0xDB, 0x88, 0x00, 0x00, 0xDC, 0x77, 0x00, 0x00, 0xDD, 0x55, 0x00, 0x00, 0xDE, 0x44, 0x00, 0x00, 0xDF,
0x22, 0x00, 0x00, 0xE0, 0x11, 0x00, 0x00, 0xE1, 0x00, 0xEE, 0x00, 0xE2, 0x00, 0xDD, 0x00, 0xE3, 0x00, 0xBB, 0x00,
0xE4, 0x00, 0xAA, 0x00, 0xE5, 0x00, 0x88, 0x00, 0xE6, 0x00, 0x77, 0x00, 0xE7, 0x00, 0x55, 0x00, 0xE8, 0x00, 0x44,
0x00, 0xE9, 0x00, 0x22, 0x00, 0xEA, 0x00, 0x11, 0x00, 0xEB, 0x00, 0x00, 0xEE, 0xEC, 0x00, 0x00, 0xDD, 0xED, 0x00,
0x00, 0xBB, 0xEE, 0x00, 0x00, 0xAA, 0xEF, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x00, 0x77, 0xF1, 0x00, 0x00, 0x55, 0xF2,
0x00, 0x00, 0x44, 0xF3, 0x00, 0x00, 0x22, 0xF4, 0x00, 0x00, 0x11, 0xF5, 0xEE, 0xEE, 0xEE, 0xF6, 0xDD, 0xDD, 0xDD,
0xF7, 0xBB, 0xBB, 0xBB, 0xF8, 0xAA, 0xAA, 0xAA, 0xF9, 0x88, 0x88, 0x88, 0xFA, 0x77, 0x77, 0x77, 0xFB, 0x55, 0x55,
0x55, 0xFC, 0x44, 0x44, 0x44, 0xFD, 0x22, 0x22, 0x22, 0xFE, 0x11, 0x11, 0x11, 0xFF, 0x00, 0x00, 0x00,
};

View File

@ -41,6 +41,8 @@ enum PbDeviceType {
SCHS = 8;
// Printer device
SCLP = 9;
// PowerView device
SCPV = 10;
}
// piscsi remote operations, returning PbResult

View File

@ -1,12 +1,12 @@
make all -j4 DEBUG=1
sudo systemctl stop rascsi
sudo systemctl stop piscsi
sudo make install
sudo systemctl start rascsi
sudo systemctl start piscsi
sleep 1
rasctl -c attach -i 4 -f powerview
#rasctl -c attach -i 0 -f /home/pi/images/RaSCSI-BootstrapV3.hda
#rasctl -c attach -i 0 -f /home/pi/images/claris_works.hda
rasctl -l
tail -f /var/log/rascsi.log
tail -f /var/log/piscsi.log

View File

@ -179,5 +179,11 @@ static const unordered_map<scsi_command, pair<int, const char*>> command_mapping
{scsi_command::eCmdSynchronizeCache16, make_pair(16, "SynchronizeCache16")},
{scsi_command::eCmdReadCapacity16_ReadLong16, make_pair(16, "ReadCapacity16/ReadLong16")},
{scsi_command::eCmdWriteLong16, make_pair(16, "WriteLong16")},
{scsi_command::eCmdReportLuns, make_pair(12, "ReportLuns")}};
{scsi_command::eCmdReportLuns, make_pair(12, "ReportLuns")},
{scsi_command::eCmdPvReadConfig, make_pair(6, "eCmdPvReadConfig")},
{scsi_command::eCmdPvWriteConfig, make_pair(6, "eCmdPvWriteConfig")},
{scsi_command::eCmdPvWriteFrameBuffer, make_pair(6, "eCmdPvWriteFrameBuffer")},
{scsi_command::eCmdPvWriteColorPalette, make_pair(6, "eCmdPvWriteColorPalette")},
{scsi_command::eCmdUnknownPowerViewCC, make_pair(6, "eCmdUnknownPowerViewCC")}};
}; // namespace scsi_defs