public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* DOC2000 + GRUB/LILO booting problems
@ 2002-03-14 15:20 Veselin Mijuskovic
  2002-03-14 16:06 ` Ilguiz Latypov
  0 siblings, 1 reply; 7+ messages in thread
From: Veselin Mijuskovic @ 2002-03-14 15:20 UTC (permalink / raw)
  To: linux-mtd

	Hi!

	I have a Advantech SBC with DOC2000. I have used M-Sys drivers for a 
while, but choose to switch to 2.4.x kernels and MTD. I could manage to create
partition (/dev/nftla1) and install everything on it (a have also one IDE disk
connected). However, I couldn't manage to boot the system from DOC2000. First
I tried mtd-lilo and kernel loads fine but fails to mount the root partiton;
VFS panics and says that it could not mount root partition from the device 03:03.
No matter what I do, changing the root device with rdev and such, it always 
complains that it wish to mount device 03:03.

	So I switched to GRUB. I've grabbed the source from the CVS and installed
the patch from the mtd/patches and it compiled fine. I've used ./doc_loadbios
to install the grub_firmware and rebooted. It loaded GRUB and I've got the 
'grub>' prompt, but I couldn't load the kernel as it complains that it can 
find the DOC drive (dc0) but could not recognize the partition (replying something
like 'using the whole disk'). The command 'root (dc0,0)' fails, as well as 
find. The partition /dev/nftla1 can be mounted with no problems when I boot from
disk. I've used the DOC2000 with DOS on it, and just created the partition with
'fdisk' and formatted it with 'mke2fs'. What can be wrong and is there something
that I should do but didn't?

Thanks in advance,
-- 
 | \|/ Panzer (a.k.a Veselin Mijuskovic), Unix SysAdmin 
/|\ |  Computer Centre, School of Electical Engineering, University of Belgrade
-------------------------------------------------------------------------------
       Unix is very friendly, it's just picky about who its friends are

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOC2000 + GRUB/LILO booting problems
  2002-03-14 15:20 Veselin Mijuskovic
@ 2002-03-14 16:06 ` Ilguiz Latypov
  2002-03-18 13:48   ` Veselin Mijuskovic
  0 siblings, 1 reply; 7+ messages in thread
From: Ilguiz Latypov @ 2002-03-14 16:06 UTC (permalink / raw)
  To: Veselin Mijuskovic; +Cc: linux-mtd

Veselin,

Could you overwrite the NFTL information when installing grub_firmware?  I 
believe one can re-format the chip with
    nftl_format /dev/mtd0 0x18000

The offset of NFTL layer must be the first available erase unit.

Ilguiz

On Thu, 14 Mar 2002, Veselin Mijuskovic wrote:

> The command 'root (dc0,0)' fails, as well as find. The partition
> /dev/nftla1 can be mounted with no problems when I boot from disk.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOC2000 + GRUB/LILO booting problems
  2002-03-14 16:06 ` Ilguiz Latypov
@ 2002-03-18 13:48   ` Veselin Mijuskovic
  0 siblings, 0 replies; 7+ messages in thread
From: Veselin Mijuskovic @ 2002-03-18 13:48 UTC (permalink / raw)
  To: Ilguiz Latypov

Ilguiz Latypov [Thu, Mar 14, 2002 at 11:06:28AM -0500, Re: DOC2000 + GRUB/LILO booting problems]:
> 
> Veselin,
> 
> Could you overwrite the NFTL information when installing grub_firmware?  

	I'm pretty new to MTD and all these stuff, but if this is the 
case, how the kernel mounts the /dev/nftla1 with no problems at all when I 
boot from the hard disk?

> I believe one can re-format the chip with
>     nftl_format /dev/mtd0 0x18000
> 
	
	Isn't it dangerous? It's a 16MB DOC2000 - are these the right
parameters? Can I overwrite bad block table with the above command?
How can I recover bad block table (I can make 'dd if=/dev/mtd0 of=some_file'
to create a backup copy, can I)?

	Sorry to bother you with this, but it's rather important.

Cheers,
-- 
 | \|/ Panzer (a.k.a Veselin Mijuskovic), Unix SysAdmin 
/|\ |  Computer Centre, School of Electical Engineering, University of Belgrade
-------------------------------------------------------------------------------
       Unix is very friendly, it's just picky about who its friends are

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOC2000 + GRUB/LILO booting problems
@ 2002-03-18 15:34 Ilguiz Latypov
  2002-03-18 15:57 ` David Woodhouse
  0 siblings, 1 reply; 7+ messages in thread
From: Ilguiz Latypov @ 2002-03-18 15:34 UTC (permalink / raw)
  To: Linux MTD mailing list

Veselin,

On Mon, 18 Mar 2002, Veselin Mijuskovic wrote:

> 	I'm pretty new to MTD and all these stuff, but if this is the 
> case, how the kernel mounts the /dev/nftla1 with no problems at all when I 
> boot from the hard disk?

I agree it might be impossible for the kernel to mount a partition
formatted within NFTL layer if NFTL data structures in the beginning of
the flash chip are overwritten.  But I don't know the exact details of the
NFTL layer myself.

> 	Isn't it dangerous? It's a 16MB DOC2000 - are these the right
> parameters? Can I overwrite bad block table with the above command? How
> can I recover bad block table (I can make 'dd if=/dev/mtd0 of=some_file'
> to create a backup copy, can I)?

The GRUB bootloader needs around 96K at minimum.  NFTL layer can be set up
after the bootloader only.  It seems the start of the NFTL layer will be
detected automatically by the kernel.  In my understanding, the kernel
will simply search for a signature in every erase unit of the chip to find
the beginning of NFTL layer.

As for the backup, the dd command should work when reading from the chip.  
As you might know, the flash sectors need to be erased to accept new data.  
I think the implementation of the system call corresponding to the write()
C library function against the /dev/mtdX MTD DoC 2000 driver will perform
the necessary "flash program" command automatically.  Perhaps, the "flash
erase" command has to be carried out explicitly through utilities like
util/erase_all.  

Of course, write()s against /dev/nftlaX driver will do the "flash erase"
command transparently.

Ilguiz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOC2000 + GRUB/LILO booting problems
  2002-03-18 15:34 DOC2000 + GRUB/LILO booting problems Ilguiz Latypov
@ 2002-03-18 15:57 ` David Woodhouse
  2002-03-18 16:17   ` Veselin Mijuskovic
  0 siblings, 1 reply; 7+ messages in thread
From: David Woodhouse @ 2002-03-18 15:57 UTC (permalink / raw)
  To: Ilguiz Latypov; +Cc: Linux MTD mailing list

ilatypov@superbt.com said:
>  I agree it might be impossible for the kernel to mount a partition
> formatted within NFTL layer if NFTL data structures in the beginning
> of the flash chip are overwritten.  But I don't know the exact details
> of the NFTL layer myself. 

It would be impossible. The two erase blocks at the beginning of the NFTL 
are required. 

>  The GRUB bootloader needs around 96K at minimum.  NFTL layer can be
> set up after the bootloader only.  It seems the start of the NFTL
> layer will be detected automatically by the kernel.  In my
> understanding, the kernel will simply search for a signature in every
> erase unit of the chip to find the beginning of NFTL layer.

Correct. The best way to do this is to use the DOS dformat program to 
reserve that 96KiB, then put Grub in afterwards. We should probably work 
out how to make the .EXB file format that DFORMAT uses, so we can actually 
use DFORMAT to program Grub too.

--
dwmw2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOC2000 + GRUB/LILO booting problems
  2002-03-18 15:57 ` David Woodhouse
@ 2002-03-18 16:17   ` Veselin Mijuskovic
       [not found]     ` <Pine.LNX.4.44.0203181430360.23362-100000@server.superbt.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Veselin Mijuskovic @ 2002-03-18 16:17 UTC (permalink / raw)
  To: linux-mtd

David Woodhouse [Mon, Mar 18, 2002 at 03:57:49PM +0000, Re: DOC2000 + GRUB/LILO booting problems]:
> 
> ilatypov@superbt.com said:
> >  I agree it might be impossible for the kernel to mount a partition
> > formatted within NFTL layer if NFTL data structures in the beginning
> > of the flash chip are overwritten.  But I don't know the exact details
> > of the NFTL layer myself. 
> 
> It would be impossible. The two erase blocks at the beginning of the NFTL 
> are required. 
> 
> >  The GRUB bootloader needs around 96K at minimum.  NFTL layer can be
> > set up after the bootloader only.  It seems the start of the NFTL
> > layer will be detected automatically by the kernel.  In my
> > understanding, the kernel will simply search for a signature in every
> > erase unit of the chip to find the beginning of NFTL layer.
> 
> Correct. The best way to do this is to use the DOS dformat program to 
> reserve that 96KiB, then put Grub in afterwards. We should probably work 
> out how to make the .EXB file format that DFORMAT uses, so we can actually 
> use DFORMAT to program Grub too.
> 

	Thanks, but the question remains the same: why GRUB can't recognize the
partition on my DOC2000 (After booting from DOC2000 I come up with the 'grub>'
prompt but it says that it can't find any partition on dc0 (which is detected OK)),
and the kernel booted from the hard disk does and can with no problems at all
access /dev/nftla1. Can there be any problem with the GRUB patch? I've co
it from the CVS on March 13th (yeah, bad luck!) along with the rest of the MTD
code (but used the MTD kernel code from the stock 2.4.18) as well as the GRUB
source itself.

	And why does LILO behaves the same?

Cheers,
-- 
 | \|/ Panzer (a.k.a Veselin Mijuskovic), Unix SysAdmin 
/|\ |  Computer Centre, School of Electical Engineering, University of Belgrade
-------------------------------------------------------------------------------
       Unix is very friendly, it's just picky about who its friends are

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DOC2000 + GRUB/LILO booting problems
       [not found]     ` <Pine.LNX.4.44.0203181430360.23362-100000@server.superbt.com>
@ 2002-03-19 11:24       ` Veselin Mijuskovic
  0 siblings, 0 replies; 7+ messages in thread
From: Veselin Mijuskovic @ 2002-03-19 11:24 UTC (permalink / raw)
  To: Ilguiz Latypov; +Cc: linux-mtd

Ilguiz Latypov [Mon, Mar 18, 2002 at 02:39:10PM -0500, Re: DOC2000 + GRUB/LILO booting problems]:
> 
> Veselin,
> 
> Can you enable DoC GRUB debug messages in stage2/shared.h?  Uncomment the
> DOC_DEBUG macro definition there.  One can add DOC_THOROUGH_DEBUG to see 
> the content of the first NFTL sector, a master boot record.
> 
> Ilguiz
> 

	I'll try that. You will have my report by Thursday.

Cheers,
-- 
 | \|/ Panzer (a.k.a Veselin Mijuskovic), Unix SysAdmin 
/|\ |  Computer Centre, School of Electical Engineering, University of Belgrade
-------------------------------------------------------------------------------
       Unix is very friendly, it's just picky about who its friends are

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-03-19 11:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-18 15:34 DOC2000 + GRUB/LILO booting problems Ilguiz Latypov
2002-03-18 15:57 ` David Woodhouse
2002-03-18 16:17   ` Veselin Mijuskovic
     [not found]     ` <Pine.LNX.4.44.0203181430360.23362-100000@server.superbt.com>
2002-03-19 11:24       ` Veselin Mijuskovic
  -- strict thread matches above, loose matches on Subject: below --
2002-03-14 15:20 Veselin Mijuskovic
2002-03-14 16:06 ` Ilguiz Latypov
2002-03-18 13:48   ` Veselin Mijuskovic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox