This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RedBoot - Minor IDE debug improvement


Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.90
diff -u -5 -p -r1.90 ChangeLog
--- redboot/current/ChangeLog	14 Feb 2003 02:49:06 -0000	1.90
+++ redboot/current/ChangeLog	14 Feb 2003 16:29:38 -0000
@@ -1,10 +1,16 @@
 2003-02-14  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* 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>
 
 	* src/main.c (return_to_redboot): Add CYGARC_HAL_RESTORE_GP.
 
Index: redboot/current/src/fs/e2fs.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/fs/e2fs.c,v
retrieving revision 1.6
diff -u -5 -p -r1.6 e2fs.c
--- redboot/current/src/fs/e2fs.c	18 Dec 2002 13:03:17 -0000	1.6
+++ redboot/current/src/fs/e2fs.c	14 Feb 2003 16:28:59 -0000
@@ -7,10 +7,11 @@
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // 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
 // Software Foundation; either version 2 or (at your option) any later version.
 //
@@ -133,11 +134,11 @@ e2fs_get_inode(e2fs_desc_t *e2fs, int in
     sec_nr += offset / SECTOR_SIZE;
 
     // 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
 
     if (!PARTITION_READ(e2fs->part, sec_nr, buf, 1))
@@ -267,10 +268,13 @@ search_dir_block(e2fs_desc_t *e2fs, cyg_
 {
     e2fs_dir_entry_t *dir;
     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);
 	reclen = SWAB_LE16(dir->reclen);
 	offset += reclen;
@@ -358,11 +362,11 @@ e2fs_follow_symlink(e2fs_desc_t *e2fs, c
     cyg_uint32 block_nr;
     e2fs_inode_t inode;
 
     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;
     }
 
     pathlen = SWAB_LE32(inode.size);
Index: redboot/current/src/fs/ide.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/fs/ide.c,v
retrieving revision 1.6
diff -u -5 -p -r1.6 ide.c
--- redboot/current/src/fs/ide.c	23 May 2002 23:08:33 -0000	1.6
+++ redboot/current/src/fs/ide.c	14 Feb 2003 16:30:55 -0000
@@ -7,10 +7,11 @@
 //==========================================================================
 //####ECOSGPLCOPYRIGHTBEGIN####
 // -------------------------------------------
 // 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
 // Software Foundation; either version 2 or (at your option) any later version.
 //
@@ -439,12 +440,15 @@ ide_init(void)
 	    //
 	    HAL_IDE_WRITE_UINT8(i, IDE_REG_DEVICE, DEV_INIT_VAL);
 	    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;
 
 	    if (ide_ident(i, j, 0, (cyg_uint16 *)buf) <= 0) {


-- 
------------------------------------------------------------
Gary Thomas                 |
MLB Associates              |  Consulting for the
+1 (970) 229-1963           |    Embedded world
http://www.mlbassoc.com/    |
email: <gary@mlbassoc.com>  |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]