Chameleon

Chameleon Svn Source Tree

Root/branches/xZen/i386/modules/Disk/Main.cpp

Source at commit 1205 created 12 years 9 months ago.
By meklort, Change Partiiton to public when extended by GUIDPartition...
1/*
2 * Copyright (c) 2011 Evan Lojewski. All rights reserved.
3 *
4 */
5
6#include <IOKit/IOTypes.h>
7#include <BiosDisk.hpp>
8#include <GUIDPartition.hpp>
9
10extern "C"
11{
12#include "libsaio.h"
13 void Disk_start();
14}
15
16void Disk_start()
17{
18 UInt8* mbr = (UInt8*)malloc(512);
19
20 BiosDisk* disk = new BiosDisk("bios:/hd0/");
21 if(disk->probe())
22 {
23 disk->Read(0, 1, mbr);
24 printf("mbr[0] = 0x%X\n", mbr[0]);
25
26 printf("mbr[510] = 0x%X\n", mbr[510]);
27 printf("mbr[511] = 0x%X\n", mbr[511]);
28
29
30 GUIDPartition* partition = new GUIDPartition(disk, 0);
31 if(partition->probe())
32 {
33 partition->Read(0, 1, mbr);
34 printf("GUID[0]/[0] = 0x%X\n", mbr[0]);
35
36 }
37 }
38
39
40 printf("This is a simple BootDisk_start test.\n");
41 delete disk;
42
43
44
45 halt();
46}

Archive Download this file

Revision: 1205