Index: trunk/i386/libsaio/biosfn.c =================================================================== --- trunk/i386/libsaio/biosfn.c (revision 2601) +++ trunk/i386/libsaio/biosfn.c (revision 2602) @@ -1042,3 +1042,10 @@ bios(&bb); } +void enableA20(void) +{ + bzero(&bb, sizeof bb); // Note: may be called before BSS section is initialized + bb.intno = 0x15; + bb.eax.rr = 0x2401; + bios(&bb); +} Index: trunk/i386/libsaio/misc.c =================================================================== --- trunk/i386/libsaio/misc.c (revision 2601) +++ trunk/i386/libsaio/misc.c (revision 2602) @@ -46,6 +46,7 @@ #include "libsaio.h" +#if UNUSED /* * keyboard controller (8042) I/O port addresses */ @@ -70,7 +71,7 @@ //========================================================================== // Enable A20 gate to be able to access memory above 1MB - +static inline void flushKeyboardInputBuffer(); static inline void flushKeyboardInputBuffer() { unsigned char ret; @@ -107,6 +108,7 @@ /* wait until done */ flushKeyboardInputBuffer(); } +#endif /* UNUSED */ //========================================================================== // Return the platform name for this hardware. Index: trunk/i386/libsaio/saio_internal.h =================================================================== --- trunk/i386/libsaio/saio_internal.h (revision 2601) +++ trunk/i386/libsaio/saio_internal.h (revision 2602) @@ -72,6 +72,7 @@ extern unsigned long getExtendedMemorySize(); extern unsigned long getConventionalMemorySize(); extern void sleep(int n); +extern void enableA20(void); /* bootstruct.c */ extern void initKernBootStruct(void); @@ -137,7 +138,6 @@ long AllocateMemoryRange(char *rangeName, long start, long length, long type); /* misc.c */ -extern void enableA20(void); extern int checkForSupportedHardware(); extern int isLaptop(); extern void getPlatformName(char *nameBuf); Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 2601) +++ trunk/i386/boot2/boot.c (revision 2602) @@ -420,9 +420,9 @@ // own things, and then calls common_boot. void boot(int biosdev) { - initialize_runtime(); // Enable A20 gate before accessing memory above 1Mb. enableA20(); + initialize_runtime(); common_boot(biosdev); } Index: trunk/i386/libsa/zalloc.c =================================================================== --- trunk/i386/libsa/zalloc.c (revision 2601) +++ trunk/i386/libsa/zalloc.c (revision 2602) @@ -75,7 +75,7 @@ zalloc_base = start ? start : (char *)ZALLOC_ADDR; totalNodes = nodes ? nodes : ZALLOC_NODES; zalloced = (zmem *) zalloc_base; - zavailable = (zmem *) zalloc_base + sizeof(zmem) * totalNodes; + zavailable = (zmem *) (zalloc_base + sizeof(zmem) * totalNodes); zavailable[0].start = (char *)zavailable + sizeof(zmem) * totalNodes; if (size == 0) Index: trunk/CHANGES =================================================================== --- trunk/CHANGES (revision 2601) +++ trunk/CHANGES (revision 2602) @@ -1,3 +1,5 @@ +- Zenith432 : Fix bug in malloc_init, use bios for enableA20() +- meklort : Slightly improve decive selection name - add os version. - Zenith432 : Interrupt Management - Bungo : Added ability to auto-select last booted partition as the boot volume. - Bungo : Added MacOSVerCurrent and MacOSVer2Int function to use instead of macros.