changeset 634:8285bebc3a89

Minor IDE [debug] improvements.
author gthomas
date Fri, 14 Feb 2003 16:31:39 +0000
parents 62d320796ef8
children d05b9af3c4e5
files packages/redboot/current/ChangeLog packages/redboot/current/src/fs/e2fs.c packages/redboot/current/src/fs/ide.c
diffstat 3 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packages/redboot/current/ChangeLog
+++ b/packages/redboot/current/ChangeLog
@@ -3,6 +3,12 @@ 2003-02-14  Jonathan Larmour  <jifl@eCos
 	* cdl/redboot.cdl: Put virtually all options inside
 	CYGBLD_BUILD_REDBOOT. And indent accordingly.
 
+2003-02-04  Gary Thomas  <gary@mind.be>
+
+	* src/fs/ide.c: Print more info if failed to identify IDE device.
+
+	* src/fs/e2fs.c: Improved debug output.
+
 2003-02-04  Mark Salter  <msalter@redhat.com>
 2003-02-04  Brian Murphy <brian@murphy.dk>
 
--- a/packages/redboot/current/src/fs/e2fs.c
+++ b/packages/redboot/current/src/fs/e2fs.c
@@ -9,6 +9,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2003 Gary Thomas <gary@mind.be>
 //
 // eCos 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
@@ -135,7 +136,7 @@ e2fs_get_inode(e2fs_desc_t *e2fs, int in
     // and the offset within that sector.
     offset %= SECTOR_SIZE;
 
-#if DEBUG_E2FS > 0
+#if DEBUG_E2FS > 0x08
     diag_printf("%s: ino[%d], sec_nr[%d] offset[%d]\n", __FUNCTION__,
                 ino, sec_nr, offset);
 #endif
@@ -269,6 +270,9 @@ search_dir_block(e2fs_desc_t *e2fs, cyg_
     cyg_uint16 reclen, len;
     cyg_uint32 offset;
 
+#if DEBUG_E2FS > 0
+    diag_dump_buf(blkbuf, e2fs->blocksize);
+#endif
     offset = 0;
     while (offset < e2fs->blocksize) {
 	dir = (e2fs_dir_entry_t *)((char *)blkbuf + offset);
@@ -360,7 +364,7 @@ e2fs_follow_symlink(e2fs_desc_t *e2fs, c
 
     if (!e2fs_get_inode(e2fs, sym_ino, &inode)) {
 #if DEBUG_E2FS > 0
-	diag_printf("%s: e2fs_get_inode [%d] failed\n", __FUNCTION__, *ino);
+	diag_printf("%s: e2fs_get_inode [%d] failed\n", __FUNCTION__, sym_ino);
 #endif
 	return 0;
     }
--- a/packages/redboot/current/src/fs/ide.c
+++ b/packages/redboot/current/src/fs/ide.c
@@ -9,6 +9,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2003 Gary Thomas <gary@mind.be>
 //
 // eCos 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
@@ -441,8 +442,11 @@ ide_init(void)
 	    HAL_IDE_WRITE_UINT8(i, IDE_REG_FEATURES, 0);
 	    CYGACC_CALL_IF_DELAY_US(50000);
 	    HAL_IDE_READ_UINT8(i, IDE_REG_DEVICE, u8);
-	    if (u8 != DEV_INIT_VAL)
+	    if (u8 != DEV_INIT_VAL) {
+                diag_printf("IDE failed to identify unit %d - wrote: %x, read: %x\n", 
+                            i, DEV_INIT_VAL, u8);
 		continue;
+            }
 
 	    // device present
 	    priv->flags |= IDE_DEV_PRESENT;