Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpc/stand/hpcboot modify for PSION NETBOOK PRO.
details: https://anonhg.NetBSD.org/src/rev/785a4231e78a
branches: trunk
changeset: 771494:785a4231e78a
user: nonaka <nonaka%NetBSD.org@localhost>
date: Wed Nov 23 15:49:57 2011 +0000
description:
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.
diffstat:
sys/arch/hpc/stand/hpcboot/file_ufs.cpp | 18 +++++++++++++-----
sys/arch/hpc/stand/hpcboot/menu/menu.cpp | 21 +++++++++++++++++++--
sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc | 3 ++-
sys/arch/hpc/stand/hpcboot/res/resource.h | 29 +++++++++++++++--------------
4 files changed, 49 insertions(+), 22 deletions(-)
diffs (139 lines):
diff -r c2c6f171b032 -r 785a4231e78a sys/arch/hpc/stand/hpcboot/file_ufs.cpp
--- a/sys/arch/hpc/stand/hpcboot/file_ufs.cpp Wed Nov 23 15:43:39 2011 +0000
+++ b/sys/arch/hpc/stand/hpcboot/file_ufs.cpp Wed Nov 23 15:49:57 2011 +0000
@@ -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 @@
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;
}
diff -r c2c6f171b032 -r 785a4231e78a sys/arch/hpc/stand/hpcboot/menu/menu.cpp
--- a/sys/arch/hpc/stand/hpcboot/menu/menu.cpp Wed Nov 23 15:43:39 2011 +0000
+++ b/sys/arch/hpc/stand/hpcboot/menu/menu.cpp Wed Nov 23 15:49:57 2011 +0000
@@ -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 @@
//
// 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 @@
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;
diff -r c2c6f171b032 -r 785a4231e78a sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc
--- a/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc Wed Nov 23 15:43:39 2011 +0000
+++ b/sys/arch/hpc/stand/hpcboot/res/hpcmenu.rc Wed Nov 23 15:49:57 2011 +0000
@@ -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 @@
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\\"
diff -r c2c6f171b032 -r 785a4231e78a sys/arch/hpc/stand/hpcboot/res/resource.h
--- a/sys/arch/hpc/stand/hpcboot/res/resource.h Wed Nov 23 15:43:39 2011 +0000
+++ b/sys/arch/hpc/stand/hpcboot/res/resource.h Wed Nov 23 15:49:57 2011 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index