Author: fireball Date: Mon Jun 4 01:27:34 2007 New Revision: 26982
URL: http://svn.reactos.org/svn/reactos?rev=26982&view=rev Log: - Add OLPC machine implementation to FreeLdr (all code based on arty's work in powerpc's mach.c).\ - Help stuff, header files, etc. - A hack in the BootPart resolving, should be done in a correct way (so that it includes the ...disk@0 part too).
Technically, FreeLdr runs now, but looks ugly, and there is a problem with keyboard input and RTC.
Added: branches/olpc/boot/freeldr/freeldr/arch/i386/macholpc.c branches/olpc/boot/freeldr/freeldr/include/arch/i386/macholpc.h Modified: branches/olpc/boot/freeldr/freeldr/arch/i386/archmach.c branches/olpc/boot/freeldr/freeldr/arch/i386/ofw/lib.c branches/olpc/boot/freeldr/freeldr/freeldr.c branches/olpc/boot/freeldr/freeldr/freeldr_arch.rbuild branches/olpc/boot/freeldr/freeldr/include/arch/i386/of_call.h branches/olpc/boot/freeldr/freeldr/include/freeldr.h
Modified: branches/olpc/boot/freeldr/freeldr/arch/i386/archmach.c URL: http://svn.reactos.org/svn/reactos/branches/olpc/boot/freeldr/freeldr/arch/i... ============================================================================== --- branches/olpc/boot/freeldr/freeldr/arch/i386/archmach.c (original) +++ branches/olpc/boot/freeldr/freeldr/arch/i386/archmach.c Mon Jun 4 01:27:34 2007 @@ -19,10 +19,13 @@
#include <freeldr.h>
+int ofwprintf(char *fmt, ...); + VOID MachInit(const char *CmdLine) { ULONG PciId; + ULONG ClId;
memset(&MachVtbl, 0, sizeof(MACHVTBL));
@@ -33,9 +36,20 @@ if (0x02a510de == PciId) { XboxMachInit(CmdLine); + HalpCalibrateStallExecution(); + return; + } + + /* Check for OLPC by reading 0xffff.fffc0, it should be CL1 */ + ClId = *((ULONG *)0xffffffc0); + + if ((ClId & 0xFFFFFF) == 'C' + ('L' << 8) + ('1' << 16)) + { + OlpcMachInit(CmdLine); } else { + /* Ordinary PC arch */ PcMachInit(CmdLine); }
Added: branches/olpc/boot/freeldr/freeldr/arch/i386/macholpc.c URL: http://svn.reactos.org/svn/reactos/branches/olpc/boot/freeldr/freeldr/arch/i... ============================================================================== --- branches/olpc/boot/freeldr/freeldr/arch/i386/macholpc.c (added) +++ branches/olpc/boot/freeldr/freeldr/arch/i386/macholpc.c Mon Jun 4 01:27:34 2007 @@ -1,0 +1,452 @@ +/* $Id: machOlpc.c 21339 2006-03-18 22:09:16Z peterw $ + * + * FreeLoader + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <freeldr.h> + +/* OFW's stdin / stdout */ +FILE *stdin_handle; +FILE *stdout_handle; + +static int chosen_package, part_handle = -1, kernel_mem = 0; + +char BootPath[0x100] = { 0 }, BootPart[0x100] = { 0 }, CmdLine[0x100] = { "bootprep" }; + +volatile char *video_mem = 0; + + + +VOID +OlpcMachInit(const char *CmdLine_) +{ + int i, len; + char *sep; + /* Initialize our stuff */ + //OlpcMemInit(); + //OlpcVideoInit(); + + chosen_package = OFFinddevice( "/chosen" ); + OFGetprop(chosen_package, "bootargs", + CmdLine, sizeof(CmdLine)); + + CmdLineParse(CmdLine); + + /* Setup vtbl */ + MachVtbl.ConsPutChar = OlpcConsPutChar; + MachVtbl.ConsKbHit = OlpcConsKbHit; + MachVtbl.ConsGetCh = OlpcConsGetCh; + MachVtbl.VideoClearScreen = OlpcVideoClearScreen; + MachVtbl.VideoSetDisplayMode = OlpcVideoSetDisplayMode; + MachVtbl.VideoGetDisplaySize = OlpcVideoGetDisplaySize; + MachVtbl.VideoGetBufferSize = OlpcVideoGetBufferSize; + MachVtbl.VideoHideShowTextCursor = OlpcVideoHideShowTextCursor; + MachVtbl.VideoPutChar = OlpcVideoPutChar; + MachVtbl.VideoCopyOffScreenBufferToVRAM = OlpcVideoCopyOffScreenBufferToVRAM; + MachVtbl.VideoIsPaletteFixed = OlpcVideoIsPaletteFixed; + MachVtbl.VideoSetPaletteColor = OlpcVideoSetPaletteColor; + MachVtbl.VideoGetPaletteColor = OlpcVideoGetPaletteColor; + MachVtbl.VideoSync = OlpcVideoSync; + MachVtbl.VideoPrepareForReactOS = OlpcVideoPrepareForReactOS; + MachVtbl.GetMemoryMap = OlpcMemGetMemoryMap; + MachVtbl.DiskGetBootVolume = OlpcDiskGetBootVolume; + MachVtbl.DiskGetSystemVolume = OlpcDiskGetSystemVolume; + MachVtbl.DiskGetBootPath = OlpcDiskGetBootPath; + MachVtbl.DiskGetBootDevice = OlpcDiskGetBootDevice; + MachVtbl.DiskBootingFromFloppy = OlpcDiskBootingFromFloppy; + MachVtbl.DiskNormalizeSystemPath = OlpcDiskNormalizeSystemPath; + MachVtbl.DiskReadLogicalSectors = OlpcDiskReadLogicalSectors; + MachVtbl.DiskGetPartitionEntry = OlpcDiskGetPartitionEntry; + MachVtbl.DiskGetDriveGeometry = OlpcDiskGetDriveGeometry; + MachVtbl.DiskGetCacheableBlockCount = OlpcDiskGetCacheableBlockCount; + MachVtbl.RTCGetCurrentDateTime = OlpcRTCGetCurrentDateTime; + MachVtbl.HwDetect = OlpcHwDetect; + + /* Determine boot device */ + BootPart[0] = 0; + BootPath[0] = 0; + + ofwprintf( "Determining boot device: [%s]\n", CmdLine ); + + sep = NULL; + for( i = 0; i < strlen(CmdLine); i++ ) { + if( strncmp(CmdLine + i, "boot=", 5) == 0) { + strcpy(BootPart, CmdLine + i + 5); + sep = strchr(BootPart, ','); + if( sep ) + *sep = 0; + while(CmdLine[i] && CmdLine[i]!=',') i++; + } + } + + if( strlen(BootPart) == 0 ) + { + len = OFGetprop(chosen_package, "bootpath", + BootPath, sizeof(BootPath)); + + if( len < 0 ) len = 0; + BootPath[len] = 0; + ofwprintf( "Boot Path: %s\n", BootPath ); + + sep = strrchr(BootPath, ',') + 9; // HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + strcpy(BootPart, BootPath); + if( sep ) { + BootPart[sep - BootPath] = 0; + } + } + + ofwprintf( "FreeLDR starting (boot partition: %s)\n", BootPart ); + +} + +void OlpcConsPutChar( int ch ) +{ + char buf[3]; + if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; } + else { buf[0] = ch; buf[1] = 0; } + buf[2] = 0; + OFWrite(stdout_handle, buf, strlen(buf)); +} + +BOOLEAN OlpcConsKbHit() { + return FALSE; +} + +int OlpcConsGetCh() +{ + char buf; +ofwprintf("OlpcConsGetCh\n"); + OFRead(stdin_handle, &buf, 1); + return buf; +} + +void OlpcVideoClearScreen( UCHAR Attr ) +{ +} + +void OlpcVideoGetDisplaySize( PULONG Width, PULONG Height, PULONG Depth ) +{ + *Width = 80; + *Height = 25; + *Depth = 16; +} + +VIDEODISPLAYMODE OlpcVideoSetDisplayMode( char *DisplayMode, BOOLEAN Init ) +{ + //printf( "DisplayMode: %s %s\n", DisplayMode, Init ? "true" : "false" ); + if( Init && !video_mem ) + { + video_mem = MmAllocateMemory( OlpcVideoGetBufferSize() ); + } + return VideoTextMode; +} + +ULONG OlpcVideoGetBufferSize() +{ + ULONG Width, Height, Depth; + MachVideoGetDisplaySize( &Width, &Height, &Depth ); + return Width * Height * Depth / 8; +} + +void OlpcVideoHideShowTextCursor( BOOLEAN Show ) +{ + ofwprintf("HideShowTextCursor(%s)\n", Show ? "true" : "false"); +} + +VOID OlpcVideoPutChar( int Ch, UCHAR Attr, unsigned X, unsigned Y ) +{ + ofwprintf( "\033[%d;%dH%c", Y, X, Ch ); +} + +VOID OlpcVideoCopyOffScreenBufferToVRAM( PVOID Buffer ) +{ + int i,j; + ULONG w,h,d; + PCHAR ChBuf = Buffer; + int offset = 0; + + MachVideoGetDisplaySize( &w, &h, &d ); + + for( i = 0; i < h; i++ ) { + for( j = 0; j < w; j++ ) { + offset = (j * 2) + (i * w * 2); + if( ChBuf[offset] != video_mem[offset] ) { + video_mem[offset] = ChBuf[offset]; + MachVideoPutChar(ChBuf[offset],0,j+1,i+1); + } + } + } +} + +BOOLEAN OlpcVideoIsPaletteFixed() +{ + return FALSE; +} + +VOID OlpcVideoSetPaletteColor( UCHAR Color, + UCHAR Red, UCHAR Green, UCHAR Blue ) +{ + //ofwprintf( "SetPaletteColor(%x,%x,%x,%x)\n", Color, Red, Green, Blue ); +} + +VOID OlpcVideoGetPaletteColor( UCHAR Color, + UCHAR *Red, UCHAR *Green, UCHAR *Blue ) +{ + //ofwprintf( "GetPaletteColor(%x)\n", Color); +} + +VOID OlpcVideoSync() +{ + //ofwprintf( "Sync\n" ); +} + +VOID OlpcVideoPrepareForReactOS(IN BOOLEAN Setup) +{ +} + +ULONG OlpcMemGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, + ULONG MaxMemoryMapSize ) +{ + int i, memhandle, returned, total = 0, slots = 0; + int memdata[0x40]; + + ofwprintf("OlpcGetMemoryMap(%d)\n", MaxMemoryMapSize); + + memhandle = OFFinddevice("/memory"); + + returned = OFGetprop(memhandle, "available", + (char *)memdata, sizeof(memdata)); + + ofwprintf("Returned data: %d\n", returned); + if( returned == -1 ) { + ofwprintf("getprop /memory[@reg] failed\n"); + return 0; + } + + for( i = 0; i < returned; i++ ) { + ofwprintf("%x ", memdata[i]); + } + ofwprintf("\n"); + + for( i = 0; i < returned / 2; i++ ) { + BiosMemoryMap[slots].Type = 1/*MEMTYPE_USABLE*/; + BiosMemoryMap[slots].BaseAddress = memdata[i*2]; + BiosMemoryMap[slots].Length = memdata[i*2+1]; + ofwprintf("MemoryMap[%d] = (%x:%x)\n", + i, + (int)BiosMemoryMap[slots].BaseAddress, + (int)BiosMemoryMap[slots].Length); + + /* Hack for pearpc */ + if(/* kernel_mem */FALSE) { + /*BiosMemoryMap[slots].Length = kernel_mem * 1024; + if( !FixedMemory ) { + OFClaim((int)BiosMemoryMap[slots].BaseAddress, + (int)BiosMemoryMap[slots].Length, + 0x1000); + FixedMemory = BiosMemoryMap[slots].BaseAddress; + } + total += BiosMemoryMap[slots].Length; + slots++;*/ + break; + /* Normal way */ + } else if( BiosMemoryMap[slots].Length && + OFClaim((int)BiosMemoryMap[slots].BaseAddress, + (int)BiosMemoryMap[slots].Length, + 0x1000) ) { + total += BiosMemoryMap[slots].Length; + slots++; + } + } + + ofwprintf( "Returning memory map (%dk total)\n", total / 1024 ); + + return slots; +} + +BOOLEAN OlpcDiskReadLogicalSectors( ULONG DriveNumber, ULONGLONG SectorNumber, + ULONG SectorCount, PVOID Buffer ) +{ + int rlen = 0; + int result; + //char * gethomedir(); + //char *homedir = gethomedir(); + + + //ofwprintf("OlpcDiskReadLogicalSectors() SN %x, SC %x\n", SectorNumber, SectorCount); //FIXME: incorrect due to SN being ULONGLONG + + if( part_handle == -1 ) + { + part_handle = OFOpen(BootPart); + + if( part_handle == -1 ) + { + ofwprintf("Could not open any disk devices we know about\n"); + return FALSE; + } + } + + //ofwprintf("Got partition handle %x\n", part_handle); + + if( part_handle == -1 ) + { + return FALSE; + } + + result = OFSeek( part_handle, + (ULONG)(SectorNumber >> 25), + (ULONG)((SectorNumber * 512) & 0xffffffff) ); + + if (result == -1) + { + ofwprintf("Seek to %x failed\n", (ULONG)(SectorNumber * 512)); + return FALSE; + } + + rlen = OFRead( part_handle, Buffer, (ULONG)(SectorCount * 512) ); + return rlen > 0; +} + +BOOLEAN OlpcDiskGetPartitionEntry( ULONG DriveNumber, ULONG PartitionNumber, + PPARTITION_TABLE_ENTRY PartitionTableEntry ) +{ + ofwprintf("GetPartitionEntry(%d,%d)\n", DriveNumber, PartitionNumber); + return FALSE; +} + +BOOLEAN OlpcDiskGetDriveGeometry( ULONG DriveNumber, PGEOMETRY DriveGeometry ) +{ + ofwprintf("GetGeometry(%d)\n", DriveNumber); + DriveGeometry->BytesPerSector = 512; + DriveGeometry->Heads = 16; + DriveGeometry->Sectors = 63; + return TRUE; +} + +ULONG OlpcDiskGetCacheableBlockCount( ULONG DriveNumber ) +{ + ofwprintf("GetCacheableBlockCount\n"); + return 1; +} + +VOID OlpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day, + PULONG Hour, PULONG Minute, PULONG Second ) +{ + //ofwprintf("RTCGeturrentDateTime\n"); + ULONG msecs = OFMilliseconds(); + *Hear = 22; + *Month = 6; + *Day = 4; + *Second = msecs / 10000; + *Minute = *Second / 60; + *Hour = *Minute / 60; +} + +VOID OlpcHwDetect() +{ + ofwprintf("OlpcHwDetect\n"); +} + +/* Strategy: + * + * For now, it'll be easy enough to use the boot command line as our boot path. + * Treat it as the path of a disk partition. We might even be able to get + * away with grabbing a partition image by tftp in this scenario. + */ + +BOOLEAN OlpcDiskGetBootVolume( PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType ) +{ + *DriveNumber = 0; + *StartSector = 0; + *SectorCount = 0; + *FsType = FS_FAT; + return TRUE; +} + +BOOLEAN OlpcDiskGetSystemVolume( char *SystemPath, + char *RemainingPath, + PULONG Device, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, + int *FsType ) +{ + char *remain = strchr(SystemPath, '\'); + if( remain ) { + strcpy( RemainingPath, remain+1 ); + } else { + RemainingPath[0] = 0; + } + *Device = 0; + return MachDiskGetBootVolume(DriveNumber, StartSector, SectorCount, FsType); +} + +BOOLEAN OlpcDiskGetBootPath( char *OutBootPath, unsigned Size ) +{ + strncpy( OutBootPath, BootPath, Size ); + return TRUE; +} + +VOID OlpcDiskGetBootDevice( PULONG BootDevice ) +{ + BootDevice[0] = BootDevice[1] = 0; +} + +BOOLEAN OlpcDiskBootingFromFloppy(VOID) +{ + return FALSE; +} + +BOOLEAN OlpcDiskNormalizeSystemPath(char *SystemPath, unsigned Size) +{ + CHAR BootPath[256]; + ULONG PartitionNumber; + ULONG DriveNumber; + PARTITION_TABLE_ENTRY PartEntry; + char *p; + + if (!DissectArcPath(SystemPath, BootPath, &DriveNumber, &PartitionNumber)) + { + return FALSE; + } + + if (0 != PartitionNumber) + { + return TRUE; + } + + if (! DiskGetActivePartitionEntry(DriveNumber, + &PartEntry, + &PartitionNumber) || + PartitionNumber < 1 || 9 < PartitionNumber) + { + return FALSE; + } + + p = SystemPath; + while ('\0' != *p && 0 != _strnicmp(p, "partition(", 10)) { + p++; + } + p = strchr(p, ')'); + if (NULL == p || '0' != *(p - 1)) { + return FALSE; + } + *(p - 1) = '0' + PartitionNumber; + + return TRUE; +}
Modified: branches/olpc/boot/freeldr/freeldr/arch/i386/ofw/lib.c URL: http://svn.reactos.org/svn/reactos/branches/olpc/boot/freeldr/freeldr/arch/i... ============================================================================== --- branches/olpc/boot/freeldr/freeldr/arch/i386/ofw/lib.c (original) +++ branches/olpc/boot/freeldr/freeldr/arch/i386/ofw/lib.c Mon Jun 4 01:27:34 2007 @@ -35,8 +35,8 @@
FILE _stdin = { -1, 0, 0}; FILE _stdout = { -1, 0, 0}; -FILE *stdin = &_stdin; -FILE *stdout = &_stdout; +FILE *stdin_handle = &_stdin; +FILE *stdout_handle = &_stdout;
char _homedir[128];
@@ -74,8 +74,8 @@
if ((ph = OFFinddevice("/chosen")) == -1) abort() ; - stdin->id = get_int_prop(ph, "stdin"); - stdout->id = get_int_prop(ph, "stdout"); + stdin_handle->id = get_int_prop(ph, "stdin"); + stdout_handle->id = get_int_prop(ph, "stdout");
argv[0] = get_str_prop(ph, "bootpath", ALLOC); argstr = get_str_prop(ph, "bootargs", ALLOC); @@ -119,12 +119,12 @@ void fputc(char c, FILE *fp) { - if (fp == stdout && c == '\n') + if (fp == stdout_handle && c == '\n') fputc('\r', fp);
fp->buf[fp->bufc++] = c;
- if ((fp->bufc == 127) || (fp == stdout && c == '\n')) { + if ((fp->bufc == 127) || (fp == stdout_handle && c == '\n')) { OFWrite(fp->id, fp->buf, fp->bufc); fp->bufc = 0; } @@ -178,19 +178,19 @@ int getchar() { - return(fgetc(stdin)); + return(fgetc(stdin_handle)); }
VOID putchar(char c) { - fputc(c, stdout); + fputc(c, stdout_handle); }
int puts(char *s) { - fputs(s, stdout); + fputs(s, stdout_handle); putchar('\n'); return(0); }
Modified: branches/olpc/boot/freeldr/freeldr/freeldr.c URL: http://svn.reactos.org/svn/reactos/branches/olpc/boot/freeldr/freeldr/freeld... ============================================================================== --- branches/olpc/boot/freeldr/freeldr/freeldr.c (original) +++ branches/olpc/boot/freeldr/freeldr/freeldr.c Mon Jun 4 01:27:34 2007 @@ -20,17 +20,14 @@ #include <freeldr.h> #include <debug.h>
-int -ofwprintf(char *fmt, ...); -VOID -OFExit( VOID ); - +int ofw_setup();
VOID BootMain(LPSTR CmdLine) { - OFExit(); - ofwprintf("Hi from the bootloader!\n"); - CmdLineParse(CmdLine); + /* Prepare OFW */ + ofw_setup(); + + //CmdLineParse(CmdLine);
MachInit(CmdLine);
Modified: branches/olpc/boot/freeldr/freeldr/freeldr_arch.rbuild URL: http://svn.reactos.org/svn/reactos/branches/olpc/boot/freeldr/freeldr/freeld... ============================================================================== --- branches/olpc/boot/freeldr/freeldr/freeldr_arch.rbuild (original) +++ branches/olpc/boot/freeldr/freeldr/freeldr_arch.rbuild Mon Jun 4 01:27:34 2007 @@ -29,6 +29,7 @@ <file>pcrtc.c</file> <file>pcvideo.c</file> <file>portio.c</file> + <file>macholpc.c</file> <file>machxbox.c</file> <file>xboxcons.c</file> <file>xboxdisk.c</file>
Added: branches/olpc/boot/freeldr/freeldr/include/arch/i386/macholpc.h URL: http://svn.reactos.org/svn/reactos/branches/olpc/boot/freeldr/freeldr/includ... ============================================================================== --- branches/olpc/boot/freeldr/freeldr/include/arch/i386/macholpc.h (added) +++ branches/olpc/boot/freeldr/freeldr/include/arch/i386/macholpc.h Mon Jun 4 01:27:34 2007 @@ -1,0 +1,81 @@ +/* $Id: machOlpc.h 25800 2007-02-14 20:30:33Z ion $ + * + * FreeLoader + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __I386_MACHOLPC_H_ +#define __I386_MACHOLPC_H_ + +#ifndef __MEMORY_H +#include "mm.h" +#endif + +UCHAR OlpcFont8x16[256 * 16]; + +VOID OlpcMachInit(const char *CmdLine); + +VOID OlpcConsPutChar(int Ch); +BOOLEAN OlpcConsKbHit(); +int OlpcConsGetCh(); + +VOID OlpcVideoInit(VOID); +VOID OlpcVideoClearScreen(UCHAR Attr); +VIDEODISPLAYMODE OlpcVideoSetDisplayMode(char *DisplayModem, BOOLEAN Init); +VOID OlpcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth); +ULONG OlpcVideoGetBufferSize(VOID); +VOID OlpcVideoSetTextCursorPosition(ULONG X, ULONG Y); +VOID OlpcVideoHideShowTextCursor(BOOLEAN Show); +VOID OlpcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y); +VOID OlpcVideoCopyOffScreenBufferToVRAM(PVOID Buffer); +BOOLEAN OlpcVideoIsPaletteFixed(VOID); +VOID OlpcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue); +VOID OlpcVideoGetPaletteColor(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue); +VOID OlpcVideoSync(VOID); +VOID OlpcVideoPrepareForReactOS(IN BOOLEAN Setup); + +VOID OlpcMemInit(VOID); +PVOID OlpcMemReserveMemory(ULONG MbToReserve); +ULONG OlpcMemGetMemoryMap(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); + +BOOLEAN OlpcDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); +BOOLEAN OlpcDiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry); +BOOLEAN OlpcDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry); +ULONG OlpcDiskGetCacheableBlockCount(ULONG DriveNumber); + +BOOLEAN OlpcDiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType); +BOOLEAN OlpcDiskGetSystemVolume(char *SystemPath, + char *RemainingPath, + PULONG Device, + PULONG DriveNumber, + PULONGLONG StartSector, + PULONGLONG SectorCount, + int *FsType); +BOOLEAN OlpcDiskGetBootPath(char *OutBootPath, unsigned Size); +VOID OlpcDiskGetBootDevice( PULONG BootDevice ); +BOOLEAN OlpcDiskNormalizeSystemPath(char *SystemPath, unsigned Size); +BOOLEAN OlpcDiskBootingFromFloppy(VOID); + +VOID OlpcRTCGetCurrentDateTime(PULONG Year, PULONG Month, PULONG Day, PULONG Hour, PULONG Minute, PULONG Second); + +VOID OlpcHwDetect(VOID); + +VOID OlpcSetLED(PCSTR Pattern); + + +#endif /* __I386_HWOLPC_H_ */ + +/* EOF */
Modified: branches/olpc/boot/freeldr/freeldr/include/arch/i386/of_call.h URL: http://svn.reactos.org/svn/reactos/branches/olpc/boot/freeldr/freeldr/includ... ============================================================================== --- branches/olpc/boot/freeldr/freeldr/include/arch/i386/of_call.h (original) +++ branches/olpc/boot/freeldr/freeldr/include/arch/i386/of_call.h Mon Jun 4 01:27:34 2007 @@ -121,3 +121,6 @@
VOID OFExit( VOID ); + +int +ofwprintf(char *fmt, ...);
Modified: branches/olpc/boot/freeldr/freeldr/include/freeldr.h URL: http://svn.reactos.org/svn/reactos/branches/olpc/boot/freeldr/freeldr/includ... ============================================================================== --- branches/olpc/boot/freeldr/freeldr/include/freeldr.h (original) +++ branches/olpc/boot/freeldr/freeldr/include/freeldr.h Mon Jun 4 01:27:34 2007 @@ -65,6 +65,8 @@ #include <arch/i386/i386.h> #include <arch/i386/machpc.h> #include <arch/i386/machxbox.h> +#include <arch/i386/macholpc.h> +#include <arch/i386/of_call.h> #include <internal/i386/intrin_i.h> #include <internal/i386/ke.h> #elif _MIPS_