Chameleon

Chameleon Svn Source Tree

Root/branches/rewrite/i386/modules/BiosDisk/Main.cpp

Source at commit 1084 created 12 years 9 months ago.
By meklort, BiosDisk Read() function working. Write() complete but untested
1/*
2 * Copyright (c) 2011 Evan Lojewski. All rights reserved.
3 *
4 */
5
6#include <IOKit/IOTypes.h>
7#include <BiosDisk.hpp>
8
9extern "C"
10{
11#include "libsaio.h"
12 void BiosDisk_start();
13}
14
15void BiosDisk_start()
16{
17 UInt8* mbr = (UInt8*)malloc(512);
18
19 BiosDisk* disk = new BiosDisk("bios:/hd0/");
20 disk->Read(0, 1, mbr);
21 printf("mbr[0] = 0x%X\n", mbr[0]);
22
23 printf("mbr[510] = 0x%X\n", mbr[510]);
24 printf("mbr[511] = 0x%X\n", mbr[511]);
25 printf("This is a simple BootDisk_start test.\n");
26 delete disk;
27
28
29
30 halt();
31}

Archive Download this file

Revision: 1084