Index: OpenHackWare-release-0.4/src/libexec/chrp.c =================================================================== --- OpenHackWare-release-0.4.orig/src/libexec/chrp.c +++ OpenHackWare-release-0.4/src/libexec/chrp.c @@ -174,48 +174,6 @@ int exec_load_chrp (inode_t *file, void crc, (char *)tag->data); #endif switch (crc) { - case 0x5464F92C: - /* Mandrake 9.1 CD1 boot script */ - case 0x4BC74ECF: - /* Mandrake 10.1 & 10.2 CD1 boot script */ - case 0x5B265246: - /* Gentoo 1.2-r1 */ - /* Gentoo 2004.1 minimal install CD */ - /* Gentoo 1.4 live CDROM */ - /* Knopix PPC beta-pre12 */ - case 0x75420D8A: - /* Debian woody */ - /* Debian 3.0r1 */ - script_type = CHRP_SCRIPT_LOAD_BOOT; - goto do_script; - case 0x633e4c9c: - /* Debian Sarge */ - case 0xbe3abf60: - /* Debian Sarge, installed on a hard disk drive */ - script_type = CHRP_SCRIPT_LOAD_BOOT; - goto do_script; - case 0x07b86bfe: - /* Linux Fedora Core 3 */ - script_type = CHRP_SCRIPT_LOAD_BOOT; - goto do_script; - case 0x9ccdf371: - script_type = CHRP_SCRIPT_LOAD_BOOT; - goto do_script; - case 0xEF423926: - /* OpenBSD 3.4 */ - case 0x68e4f265: - /* OpenBSD 3.5 */ - case 0x3b7ea9e1: - /* OpenBSD 3.6 */ - script_type = CHRP_SCRIPT_LOAD_BOOT; - goto do_script; - case 0xB7981DBC: - /* iBook 2 hw test CDROM */ -#if 1 - script_type = CHRP_SCRIPT_LOAD_BOOT; - goto do_script; -#endif - case 0xEA06C1A7: /* MacOS 9.2 boot script: * the XCOFF loader is embedded in the file... @@ -243,9 +201,8 @@ int exec_load_chrp (inode_t *file, void DPRINTF("Boot file embedded at the end of boot script\n"); break; default: - ERROR("XML error: unknown Forth script: %08x\n%s\n", - crc, (char *)tag->data); - goto out; + script_type = CHRP_SCRIPT_LOAD_BOOT; + goto do_script; } break; Index: OpenHackWare-release-0.4/src/libfs/core.c =================================================================== --- OpenHackWare-release-0.4.orig/src/libfs/core.c +++ OpenHackWare-release-0.4/src/libfs/core.c @@ -421,13 +421,15 @@ int fs_seek (inode_t *inode, uint32_t bl int fs_read (inode_t *inode, void *buffer, int len) { - uint32_t bsize, total; + uint32_t bsize, total, max; int done, tmp; bsize = part_blocsize(inode->fs->part); total = 0; if (fs_seek(inode, inode->vbloc, inode->vpos) < 0) return -1; + max = inode->size.bloc * bsize + inode->size.offset + - inode->vbloc * bsize + inode->vpos; for (; len != 0; len -= done) { tmp = bsize - inode->vpos; if (len < tmp) @@ -444,6 +446,8 @@ int fs_read (inode_t *inode, void *buffe total += done; } + if (total > max) + return max; return total; } Index: OpenHackWare-release-0.4/src/main.ld =================================================================== --- OpenHackWare-release-0.4.orig/src/main.ld +++ OpenHackWare-release-0.4/src/main.ld @@ -49,7 +49,7 @@ SECTIONS _sdata_end = . ; . = ALIGN(4) ; _ro_start = . ; - .rodata : { *(.rodata) } > bios + .rodata : { *(.rodata*) } > bios _ro_end = . ; . = ALIGN(4) ; _RTAS_start = .; Index: OpenHackWare-release-0.4/src/of.c =================================================================== --- OpenHackWare-release-0.4.orig/src/of.c +++ OpenHackWare-release-0.4/src/of.c @@ -2371,6 +2371,14 @@ int OF_register_bus (const unsigned char sprintf(buffer, "/%s", name); OF_prop_string_set(OF_env, als, name, buffer); /* For ISA, should add DMA ranges */ + if (!strcmp(type, "ISA")) { + uint32_t ranges[4]; + ranges[0] = 0x1; + ranges[1] = 0x0; + ranges[2] = address; + ranges[3] = 0x00800000; + OF_property_new(OF_env, bus, "ranges", ranges, 16); + } OF_node_put(OF_env, bus); OF_node_put(OF_env, als); @@ -2385,6 +2393,7 @@ int OF_register_serial (const unsigned c unsigned char tmp[OF_NAMELEN_MAX]; OF_env_t *OF_env; OF_node_t *busn, *srl, *als; + uint32_t reg[3]; OF_env = OF_env_main; als = OF_node_get(OF_env, "aliases"); @@ -2401,14 +2410,19 @@ int OF_register_serial (const unsigned c } OF_prop_string_set(OF_env, srl, "device_type", "serial"); OF_prop_string_set(OF_env, srl, "compatible", "pnpPNP,501"); + reg[0] = 1; /* IO space */ + reg[1] = io_base; /* base address */ + reg[2] = 8; /* range length */ switch (io_base) { case 0x3F8: OF_pack_get_path(OF_env, tmp, 512, srl); OF_prop_string_new(OF_env, als, "com1", tmp); + OF_property_new(OF_env, srl, "reg", reg, 12); break; case 0x2F8: OF_pack_get_path(OF_env, tmp, 512, srl); OF_prop_string_new(OF_env, als, "com2", tmp); + OF_property_new(OF_env, srl, "reg", reg, 12); break; default: break; @@ -4058,7 +4072,7 @@ static void OF_nextprop (OF_env_t *OF_en OF_DPRINTF("Return property name [%s]\n", next->name); OF_sts(next_name, (void *)(next->name)); OF_DUMP_STRING(OF_env, next_name); - pushd(OF_env, strlen(next->name) + 1); + pushd(OF_env, 1); } } }