Module Name: src Committed By: nonaka Date: Wed Nov 23 15:49:58 UTC 2011
Modified Files: src/sys/arch/hpc/stand/hpcboot: file_ufs.cpp src/sys/arch/hpc/stand/hpcboot/menu: menu.cpp src/sys/arch/hpc/stand/hpcboot/res: hpcmenu.rc resource.h Log Message: modify for PSION NETBOOK PRO. - ignore "Network" directory when finding the directory for configuration files. - as the device name "SMC" (SD-MMC) to allow. - add "SMC1:/" entry to kernel directory. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpc/stand/hpcboot/file_ufs.cpp cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hpc/stand/hpcboot/menu/menu.cpp cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hpc/stand/hpcboot/res/resource.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/hpc/stand/hpcboot/file_ufs.cpp diff -u src/sys/arch/hpc/stand/hpcboot/file_ufs.cpp:1.4 src/sys/arch/hpc/stand/hpcboot/file_ufs.cpp:1.5 --- src/sys/arch/hpc/stand/hpcboot/file_ufs.cpp:1.4 Mon Apr 28 20:23:20 2008 +++ src/sys/arch/hpc/stand/hpcboot/file_ufs.cpp Wed Nov 23 15:49:57 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: file_ufs.cpp,v 1.4 2008/04/28 20:23:20 martin Exp $ */ +/* $NetBSD: file_ufs.cpp,v 1.5 2011/11/23 15:49:57 nonaka Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -67,15 +67,23 @@ BOOL UfsFile::setRoot(TCHAR *drive) { char name[MAX_PATH]; - int unit; + char devname[4] = "DSK"; + int unit = 1; _to_ascii(name, drive, MAX_PATH); if ('1' <= name[0] && name[0] <= '9' && name[1] == ':') unit = name[0] - '0'; - else - unit = 1; + else if (isalpha((unsigned char)name[0]) && + isalpha((unsigned char)name[1]) && + isalpha((unsigned char)name[2]) && + '1' <= name[3] && name[3] <= '9' && name[4] == ':') { + devname[0] = name[0]; + devname[1] = name[1]; + devname[2] = name[2]; + unit = name[3] - '0'; + } - winblkopen(_f, "DSK", unit, 0); + winblkopen(_f, devname, unit, 0); return TRUE; } Index: src/sys/arch/hpc/stand/hpcboot/menu/menu.cpp diff -u src/sys/arch/hpc/stand/hpcboot/menu/menu.cpp:1.12 src/sys/arch/hpc/stand/hpcboot/menu/menu.cpp:1.13 --- src/sys/arch/hpc/stand/hpcboot/menu/menu.cpp:1.12 Tue Apr 6 16:20:28 2010 +++ src/sys/arch/hpc/stand/hpcboot/menu/menu.cpp Wed Nov 23 15:49:58 2011 @@ -1,4 +1,4 @@ -/* -*-C++-*- $NetBSD: menu.cpp,v 1.12 2010/04/06 16:20:28 nonaka Exp $ */ +/* -*-C++-*- $NetBSD: menu.cpp,v 1.13 2011/11/23 15:49:58 nonaka Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -549,6 +549,22 @@ ConsoleTabWindow::_open_log_file() // // Common utility // +static BOOL +is_ignore_directory(TCHAR *filename) +{ + static const TCHAR *dirs[] = { + // Network (in Japanese) + (const TCHAR *)"\xcd\x30\xc3\x30\xc8\x30\xef\x30\xfc\x30\xaf\x30\x00\x00", + }; + + for (int i = 0; i < sizeof(dirs) / sizeof(dirs[0]); i++) { + if (wcscmp(filename, dirs[i]) == 0) { + return TRUE; + } + } + return FALSE; +} + BOOL _find_pref_dir(TCHAR *path) { @@ -562,7 +578,8 @@ _find_pref_dir(TCHAR *path) do { int attr = fd.dwFileAttributes; if ((attr & FILE_ATTRIBUTE_DIRECTORY) && - (attr & FILE_ATTRIBUTE_TEMPORARY)) { + (attr & FILE_ATTRIBUTE_TEMPORARY) && + !is_ignore_directory(fd.cFileName)) { wcscpy(path, fd.cFileName); FindClose(find); return TRUE; Index: src/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc diff -u src/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc:1.20 src/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc:1.21 --- src/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc:1.20 Wed Sep 28 14:19:13 2011 +++ src/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc Wed Nov 23 15:49:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hpcmenu.rc,v 1.20 2011/09/28 14:19:13 nonaka Exp $ */ +/* $NetBSD: hpcmenu.rc,v 1.21 2011/11/23 15:49:58 nonaka Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -44,6 +44,7 @@ STRINGTABLE DISCARDABLE IDS_HPCMENU "HPCBOOT" IDS_DIR_FFS_ROOT1 "/" IDS_DIR_FFS_ROOT2 "2:/" + IDS_DIR_FFS_SMC_ROOT1 "SMC1:/" IDS_DIR_FAT_ROOT "\\" IDS_DIR_FAT_MY_DOCUMENTS "\\My Documents\\" IDS_DIR_CARD_EN "\\Storage Card\\" Index: src/sys/arch/hpc/stand/hpcboot/res/resource.h diff -u src/sys/arch/hpc/stand/hpcboot/res/resource.h:1.12 src/sys/arch/hpc/stand/hpcboot/res/resource.h:1.13 --- src/sys/arch/hpc/stand/hpcboot/res/resource.h:1.12 Wed Sep 28 14:19:13 2011 +++ src/sys/arch/hpc/stand/hpcboot/res/resource.h Wed Nov 23 15:49:58 2011 @@ -1,4 +1,4 @@ -/* -*-C++-*- $NetBSD: resource.h,v 1.12 2011/09/28 14:19:13 nonaka Exp $ */ +/* -*-C++-*- $NetBSD: resource.h,v 1.13 2011/11/23 15:49:58 nonaka Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -114,19 +114,20 @@ #define IDS_DIR_FFS_ROOT1 10004 #define IDS_DIR_FFS_ROOT2 10006 -#define IDS_DIR_FAT_ROOT 10008 -#define IDS_DIR_FAT_MY_DOCUMENTS 10010 -#define IDS_DIR_CARD_EN 10012 -#define IDS_DIR_CARD_EN1 10014 -#define IDS_DIR_CARD_EN2 10016 -#define IDS_DIR_CARD_JP 10018 -#define IDS_DIR_CARD_JP1 10020 -#define IDS_DIR_CARD_JP2 10022 -#define IDS_DIR_CARD_MMCARD 10024 -#define IDS_DIR_CARD_SDMMCARD 10026 -#define IDS_DIR_CARD_MINISD_JP 10028 -#define IDS_DIR_CARD_MICROSD_JP 10030 -#define IDS_DIR_USER_DEFINED 10032 +#define IDS_DIR_FFS_SMC_ROOT1 10008 +#define IDS_DIR_FAT_ROOT 10010 +#define IDS_DIR_FAT_MY_DOCUMENTS 10012 +#define IDS_DIR_CARD_EN 10014 +#define IDS_DIR_CARD_EN1 10016 +#define IDS_DIR_CARD_EN2 10018 +#define IDS_DIR_CARD_JP 10020 +#define IDS_DIR_CARD_JP1 10022 +#define IDS_DIR_CARD_JP2 10024 +#define IDS_DIR_CARD_MMCARD 10026 +#define IDS_DIR_CARD_SDMMCARD 10028 +#define IDS_DIR_CARD_MINISD_JP 10030 +#define IDS_DIR_CARD_MICROSD_JP 10032 +#define IDS_DIR_USER_DEFINED 10034 #define IDS_DIR_START IDS_DIR_FFS_ROOT1