Chameleon

Chameleon Commit Details

Date:2011-06-25 20:20:19 (3 years 2 months ago)
Author:Evan Lojewski
Commit:1075
Parents: 1074
Message:Disk code
Changes:
A/branches/rewrite/i386/modules/BiosDisk/include
A/branches/rewrite/i386/modules/BiosDisk/include/Disk.hpp
A/branches/rewrite/i386/modules/BiosDisk/Main.cpp
A/branches/rewrite/i386/modules/BiosDisk/Disk.cpp
A/branches/rewrite/i386/modules/BiosDisk/include/BiosDisk.hpp
M/branches/rewrite/i386/modules/BiosDisk/BiosDisk.cpp
M/branches/rewrite/i386/modules/BiosDisk/Makefile

File differences

branches/rewrite/i386/modules/BiosDisk/include/Disk.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* Copyright (c) 2011 Evan Lojewski. All rights reserved.
*
*/
#ifndef DISK_H
#define DISK_H
#include <IOKit/IOTypes.h>
class Disk
{
public:
Disk();
Disk(const char* name);
~Disk();
virtual IOReturn Read(UInt64 sector, UInt64 size, char* buffer) = 0;
virtual IOReturn Write(UInt64 sector, UInt64 size, char* buffer) = 0;
bool isValid() { return mName != NULL; };
protected:
const char *mName;
const char *busType;
private:
};
#endif /* DISK_H */
branches/rewrite/i386/modules/BiosDisk/include/BiosDisk.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* Copyright (c) 2011 Evan Lojewski. All rights reserved.
*
*/
#ifndef BIOSDISK_H
#define BIOSDISK_H
#include <IOKit/IOTypes.h>
#include <Disk.hpp>
#define super Disk
class BiosDisk : public Disk
{
public:
BiosDisk(const char* name);
~BiosDisk();
virtual IOReturn Read(UInt64 sector, UInt64 size, char* buffer);
virtual IOReturn Write(UInt64 sector, UInt64 size, char* buffer);
protected:
private:
UInt8 mDiskID;
};
#endif /* BIOSDISK_H */
branches/rewrite/i386/modules/BiosDisk/Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
* Copyright (c) 2011 Evan Lojewski. All rights reserved.
*
*/
#include <cstdlib>
#include <iostream>
#include <modules>
extern "C"
{
void BiosDisk_start();
}
void BiosDisk_start()
{
}
branches/rewrite/i386/modules/BiosDisk/BiosDisk.cpp
22
33
44
5
6
7
5
86
9
7
8
109
11
10
11
12
13
14
15
16
17
18
19
20
21
1222
1323
14
24
1525
16
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
* Copyright (c) 2011 Evan Lojewski. All rights reserved.
*
*/
#include <cstdlib>
#include <iostream>
#include <modules>
#include <BiosDisk.hpp>
extern "C"
BiosDisk::BiosDisk(const char* name)
{
void BiosDisk_start();
busType = "bios";
// fixme
if(name[0] != 'b' &&
name[1] != 'i' &&
name[2] != 'o' &&
name[3] != 's' &&
name[4] != ':') name = NULL;
mName = name;
// TODO: convert mName to bios disk id
}
void BiosDisk_start()
BiosDisk::~BiosDisk()
{
}
}
IOReturn BiosDisk::Read(UInt64 sector, UInt64 size, char* buffer)
{
if(!isValid()) return kIOReturnNoDevice;
return kIOReturnSuccess;
}
IOReturn BiosDisk::Write(UInt64 sector, UInt64 size, char* buffer)
{
if(!isValid()) return kIOReturnNoDevice;
return kIOReturnNotWritable;
}
branches/rewrite/i386/modules/BiosDisk/Disk.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
* Copyright (c) 2011 Evan Lojewski. All rights reserved.
*
*/
#include <Disk.hpp>
Disk::Disk()
{
mName = NULL;
}
Disk::~Disk()
{
}
branches/rewrite/i386/modules/BiosDisk/Makefile
88
99
1010
11
11
1212
1313
DIR = BiosDisk
MODULE_OBJS = BiosDisk.o
MODULE_OBJS = Disk.o BiosDisk.o Main.o
include ../MakeInc.dir

Archive Download the corresponding diff file

Revision: 1075