DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-03-31 22:01:39

Gazou
Member
Registered: 2010-01-24
Posts: 11

Netbsd working on DSM G600

Hello,

The last Netbsd seems to be fully working in DSM G600 REV B:

http://www.netbsd.org/ports/sandpoint/

Let's try to install it. If really everything is working as they claim it, it is a very good news!

Cheers

Offline

 

#2 2011-04-01 14:12:29

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

Looks like a real deal and tested.
http://ftp.estpak.ee/pub/NetBSD/misc/re … .altboot,v


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#3 2011-04-01 14:31:37

Gazou
Member
Registered: 2010-01-24
Posts: 11

Re: Netbsd working on DSM G600

Yes looks like working like a charm. Now just need to find a good "how to" to install it...

Offline

 

#4 2011-04-01 14:38:03

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

Cant comment about charm, but It might be possible to load altboot using loader.o for testing. I don't have my unit in hand so I cant test this any time soon but eventually I will convert it to bsd.

http://nyftp.netbsd.org/pub/NetBSD-dail … tallation/
altboot.bin might be loader.o ready.
altboot.img is u-boot formatted image


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#5 2011-04-01 15:25:20

Gazou
Member
Registered: 2010-01-24
Posts: 11

Re: Netbsd working on DSM G600

I will look around for a how to; will post the url if success.

Offline

 

#6 2011-04-05 17:32:39

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

I did add very basic guide which should be able to give some sense how installation can be done.  Soon http://www.netbsd.org/ports/sandpoint/ will have more complete guide available.
Also it is very possible to extract configured installation and use netbsd without serial console if altboot is loadable using loader.o.

http://dns323.kood.org/dsmg600/howto:netbsd


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#7 2011-04-05 20:36:10

Gazou
Member
Registered: 2010-01-24
Posts: 11

Re: Netbsd working on DSM G600

Ok great! Thanks; will try and let you know.
Did you took back your DSM G600 on tried it on it? Working good?

Offline

 

#8 2011-04-06 08:34:35

Gazou
Member
Registered: 2010-01-24
Posts: 11

Re: Netbsd working on DSM G600

I had a look at both links. I am waiting if any solution coming with loadable altboot, since i really don't want to play with serial console.

Last edited by Gazou (2011-04-06 09:31:20)

Offline

 

#9 2011-04-08 10:55:56

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

Hi,

I am the author of the NetBSD port and I found much valuable information on this site during development. Many thanks for that!

Of course, I am very interested in your experiences with it. You can always contact me when there are any problems. A detailed installation instruction will hopefully be finished this weekend.

Some weak points of the G600 port at the moment:
- LEDs can be controlled via /dev/satmgr, but altboot doesn't stop the power LED from blinking yet.
- The board and/or the SM8954A microcontroller do not offer any function to reboot or shutdown the system. Rebooting currently works by jumping through the firmware's reset vector.
- There is definitely a ST M41T80 RTC chip on the board. It should listen on address 0x68 of the I2C bus, but mine seems to be dead. Can anybody confirm that? What is wrong with the RTC? Does it work under Linux?

For installation a serial console is strongly recommended. You may be able to flash altboot from Linux, but you need the console for installation anyway.

What is loader.o? smile

Offline

 

#10 2011-04-08 11:09:57

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

phx wrote:

I am the author of the NetBSD port and I found much valuable information on this site during development. Many thanks for that!

Pleasure is all ours. DSM-G600 development is pretty much dead on linux side by now, so having option to use netbsd is definitely good news to many.

phx wrote:

There is definitely a ST M41T80 RTC chip on the board. It should listen on address 0x68 of the I2C bus, but mine seems to be dead. Can anybody confirm that? What is wrong with the RTC? Does it work under Linux?

By default gentoo can't use rtc on dsm-g600. I haven't look much deeper, I did just setup ntpclient since I did need one anyway because clock drift is horrible on this device using dlink kernel.

phx wrote:

What is loader.o? smile

http://dns323.kood.org/dsmg600/howto:loader_o


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#11 2011-04-08 12:32:29

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

sala wrote:

By default gentoo can't use rtc on dsm-g600. I haven't look much deeper,

Probably the chip was never working? But what a waste, to place a battery and a 32kHz oscillator on the board, just for an unused chip.
I scanned all adresses on the I2C bus, but found not a single device responding.

sala wrote:

I did just setup ntpclient since I did need one anyway because clock drift is horrible on this device using dlink kernel.

Yes, I did the same now.

sala wrote:

http://dns323.kood.org/dsmg600/howto:loader_o

Ok. I guess this won't work with altboot. The binary requires to be loaded and started at 0x1000000.
Even if it worked you still cannot install without a console.

Offline

 

#12 2011-04-08 12:47:42

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

phx wrote:

Even if it worked you still cannot install without a console.

If one makes a tarball off from its installed version then other can extract it and jump in on using it.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#13 2011-04-08 13:20:31

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

sala wrote:

If one makes a tarball off from its installed version then other can extract it and jump in on using it.

You have to create a NetBSD disklabel and file system on your disk, before you can extract such a tarball. This may be possible by putting the disk into a second NetBSD/powerpc (or at least big-endian) system, e.g. a PowerMac, and prepare it sufficiently.
Is it possible to write to flash from the original Linux installation? Then this might be a theoretical solution to go without serial console. But when something goes wrong you're blind.

Offline

 

#14 2011-04-09 21:19:35

Gazou
Member
Registered: 2010-01-24
Posts: 11

Re: Netbsd working on DSM G600

Hi Phx,

Thanks for your work, looks great.

Any chances that we could install it without the serial connector?

Thanks


phx wrote:

Hi,

I am the author of the NetBSD port and I found much valuable information on this site during development. Many thanks for that!

Of course, I am very interested in your experiences with it. You can always contact me when there are any problems. A detailed installation instruction will hopefully be finished this weekend.

Some weak points of the G600 port at the moment:
- LEDs can be controlled via /dev/satmgr, but altboot doesn't stop the power LED from blinking yet.
- The board and/or the SM8954A microcontroller do not offer any function to reboot or shutdown the system. Rebooting currently works by jumping through the firmware's reset vector.
- There is definitely a ST M41T80 RTC chip on the board. It should listen on address 0x68 of the I2C bus, but mine seems to be dead. Can anybody confirm that? What is wrong with the RTC? Does it work under Linux?

For installation a serial console is strongly recommended. You may be able to flash altboot from Linux, but you need the console for installation anyway.

What is loader.o? smile

Offline

 

#15 2011-04-10 14:49:40

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

Gazou wrote:

Any chances that we could install it without the serial connector?

Provided you got a working NetBSD/sandpoint installation onto disk (e.g. created on a second NetBSD system), the only difficulty is to run altboot. Maybe it works by patching loader.o to load and execute altboot at 0x1000000.

Offline

 

#16 2011-04-11 10:13:26

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

phx wrote:

sala wrote:

By default gentoo can't use rtc on dsm-g600. I haven't look much deeper,

Probably the chip was never working? But what a waste, to place a battery and a 32kHz oscillator on the board, just for an unused chip.
I scanned all adresses on the I2C bus, but found not a single device responding.

Now when I started to thinking back. Original firmware somewhat did make use of rtc by using rdc_rtc binary.

Thanks for guide!
http://www.netbsd.org/ports/sandpoint/instDSM-G600.html


Attachments:
Attachment Icon rdc_rtc, Size: 9,272 bytes, Downloads: 681

DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#17 2011-04-11 11:27:07

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

sala wrote:

Now when I started to thinking back. Original firmware somewhat did make use of rtc by using rdc_rtc binary.

Hmm... how was it used? The attached rdc_rtc program is an x86 ELF binary. I doubt that it worked on the G600.

sala wrote:

Thanks for guide!

It still needs some improvements, but I wanted to commit it yesterday, before it takes another week.

Offline

 

#18 2011-04-11 11:51:29

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

phx wrote:

sala wrote:

Now when I started to thinking back. Original firmware somewhat did make use of rtc by using rdc_rtc binary.

Hmm... how was it used? The attached rdc_rtc program is an x86 ELF binary. I doubt that it worked on the G600.

Sorry accidentally I did take it from TS-I300 firmware, which is very similar firmware but for x86 device.

ppc version has eth0 and sysctl string in it....


Attachments:
Attachment Icon ppc_rtc, Size: 16,284 bytes, Downloads: 648

DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#19 2011-04-11 16:59:25

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

sala wrote:

ppc version has eth0 and sysctl string in it....

That's interesting, indeed. I have disassembled the program, and as far as I understand it uses special ioctl() calls on an INET socket to access addresses in the I/O space. Something like:
  s = socket(AF_INET, SOCK_DGRAM, 0);
  ioctl(s, 0x89f8, arg);
  close(s);

The "arg" is a pointer to a structure with the following layout:
{
  char name[16];  /* filled with "eth0" */
  uint32_t ioaddr;  /* filled with an address in I/O space */
}

The addresses are in the range 0xfc003000 to 0xfc003010, which is where the 8245 I2C registers are located!

I have to read the disassembly more closely to analyze the I2C transfers. I also don't see what it has to do with eth0 yet.
Does no GPL source for this program exist?

Offline

 

#20 2011-04-11 17:17:16

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

phx wrote:

Does no GPL source for this program exist?

This one does not have gpl code as far as I know. But maybe d-link kernel source has something interesting in it?

Latest tarball of gpl code.
http://tsd.dlink.com.tw/ModelDocuView.a … o=IJLQLKGL


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#21 2011-04-12 10:30:04

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

This program does implement a complete I2C and M41T80 RTC driver. It accesses the usual RTC registers 1 to 7 at I2C bus address 0x68. It works identical to the NetBSD strtc(4) (M41ST84) driver (but without Watchdog and NVRAM).

That made me think. And indeed, after removing the battery from my board the RTC chip started working! But after another two or three restarts it was gone again, so there must be something which is confusing it.

I will investigate. But theoretically the RTC is working! smile

Offline

 

#22 2011-04-12 11:04:50

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

phx wrote:

And indeed, after removing the battery from my board the RTC chip started working! But after another two or three restarts it was gone again, so there must be something which is confusing it.

I did bring my DSM-G600 home and will install it in couple of days, so I can try myself.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#23 2011-04-17 18:22:07

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

There was a small bug in the MPC824x I2C driver in conjunction with the strtc driver. Now everything is fixed. The RTC works fine.

I also fixed the external clock, which is 33.000 MHz, not 33.333 MHz, so the system time is precise now, even after running for days.

BTW, this means the MPC8241 is running at exactly 198 MHz, not 170 MHz as U-Boot erroneously prints.

Offline

 

#24 2011-04-18 10:15:05

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: Netbsd working on DSM G600

Good work!

Yesterday I had some time to flash altboot but unexpected family duties did cut in, so that was it.
But I remember that altboot did print "IDE/SATA device driver was not found"
I was using altboot from here: http://nyftp.netbsd.org/pub/NetBSD-dail … tallation/

phx wrote:

I also fixed the external clock, which is 33.000 MHz, not 33.333 MHz, so the system time is precise now, even after running for days.

This should mean that everyone should re-flash their altboot loader.
Btw, are these changes committed to trunk? I'm still trying to get familiar with netbsd version tracking smile


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#25 2011-04-18 16:40:45

phx
Member
Registered: 2011-04-08
Posts: 15

Re: Netbsd working on DSM G600

sala wrote:

But I remember that altboot did print "IDE/SATA device driver was not found"

Hmm. This should only happen when your board has an IDE controller chip which is unknown to altboot.
Don't you have an ACARD ATP865 chip? PCI-vendor 0x1191, PCI-product 0x0008?
Otherwise it will fail and I would have to add your chip ID.

I have put a recent altboot onto our FTP server, compiled with DEBUG option, so it should generate some more information about your hardware:
http://ftp.netbsd.org/pub/NetBSD/misc/p … bug.tar.gz

sala wrote:

I was using altboot from here: http://nyftp.netbsd.org/pub/NetBSD-dail … tallation/

The 201104172300Z build has just finished and includes my latest changes.

sala wrote:

Btw, are these changes committed to trunk?

Yes, always. So the first official release with all the Sandpoint NAS ports will be 6.0.

sala wrote:

I'm still trying to get familiar with netbsd version tracking smile

For current snapshots you can use http://nyftp.netbsd.org/pub/NetBSD-daily/HEAD, that's right.
Or you can checkout the source and build it yourself, which has the advantage that you can modify the source to find a problem  - and report it to me when fixed. wink

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB