Author Topic: Bsd Off An External Usb Hdd  (Read 6134 times)

pjlasky

  • Newbie
  • *
  • Posts: 7
    • View Profile
Bsd Off An External Usb Hdd
« on: August 23, 2006, 02:20:12 pm »
Something of a newbie question re: OpenBSD on zaurus (have used OpenBSD on PCs and several Linux distros on Zaurus.)
Might it be possible to boot BSD off of an external HDD connected to a C1000 via USB?
Thanks!

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Bsd Off An External Usb Hdd
« Reply #1 on: August 23, 2006, 02:55:47 pm »
No, not without rewriting the boot loader.

The hardware probe only checks CF based drives at the moment.

If may™ be feasible to cat the kernel straight to /proc/zboot instead of using zboot to find the kernel on the root file system... the kernel then may™ latch on to the root file system on the USB disk and boot.

Getting OpenBSD onto the USB drive may also be challenging... I think I tried doing a minimal install onto a thumb drive once and it wouldn't go using the standard bsd.rd/installer.

I can understand you wanting to try this if you only have a 1000 but it sounds like you will need to shutdown when you have finished.... one of the nicest things that I find about OpenBSD is stability and long uptimes due to no need to reboot (if I'm I'm not tinkering with the Kernel or updating I never reboot - but have only stretched it to about 1 month before I wanted to do one of those things ) it's a real shame to miss out on that.

-Andy

-Andy
« Last Edit: August 23, 2006, 02:57:56 pm by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Bsd Off An External Usb Hdd
« Reply #2 on: August 23, 2006, 08:48:36 pm »
While we are on the discussion of booting can you give a brief explanation as to how the zaurus goes about using Linux to boot bsd?

Quote
No, not without rewriting the boot loader.

The hardware probe only checks CF based drives at the moment.

If may™ be feasible to cat the kernel straight to /proc/zboot instead of using zboot to find the kernel on the root file system... the kernel then may™ latch on to the root file system on the USB disk and boot.

Getting OpenBSD onto the USB drive may also be challenging... I think I tried doing a minimal install onto a thumb drive once and it wouldn't go using the standard bsd.rd/installer.

I can understand you wanting to try this if you only have a 1000 but it sounds like you will need to shutdown when you have finished.... one of the nicest things that I find about OpenBSD is stability and long uptimes due to no need to reboot (if I'm I'm not tinkering with the Kernel or updating I never reboot - but have only stretched it to about 1 month before I wanted to do one of those things ) it's a real shame to miss out on that.

-Andy

-Andy
[div align=\"right\"][a href=\"index.php?act=findpost&pid=139545\"][{POST_SNAPBACK}][/a][/div]
« Last Edit: September 01, 2006, 10:26:04 am by mathemajikian »

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Bsd Off An External Usb Hdd
« Reply #3 on: August 24, 2006, 05:30:10 am »
Quote
While we are on the discussion of booting can you give a brief explanation as to how the zaurus goes about using Linux to boot bsd?

Quote
No, not without rewriting the boot loader.

The hardware probe only checks CF based drives at the moment.

If may™ be feasible to cat the kernel straight to /proc/zboot instead of using zboot to find the kernel on the root file system... the kernel then may™ latch on to the root file system on the USB disk and boot.

Getting OpenBSD onto the USB drive may also be challenging... I think I tried doing a minimal install onto a thumb drive once and it wouldn't go using the standard bsd.rd/installer.

I can understand you wanting to try this if you only have a 1000 but it sounds like you will need to shutdown when you have finished.... one of the nicest things that I find about OpenBSD is stability and long uptimes due to no need to reboot (if I'm I'm not tinkering with the Kernel or updating I never reboot - but have only stretched it to about 1 month before I wanted to do one of those things ) it's a real shame to miss out on that.

For the interested take a look at the source tree /sys/arch/zaurus/stand - one point of interest is that zbsdmod.o and zboot even though they are Linux kernel modules and programs are actually built on OpenBSD not on Linux.

-Andy
[div align=\"right\"][a href=\"index.php?act=findpost&pid=139545\"][{POST_SNAPBACK}][/a][/div]
[div align=\"right\"][a href=\"index.php?act=findpost&pid=139590\"][{POST_SNAPBACK}][/a][/div]

boot(8) and boot_zaurus(8) give a rough overview but to clarify what zbsdmod and zboot are here is a little more information.

zbsdmod carries a set of routines to zero the MMU and device configuration, essentially wiping Linux from RAM and initializing the system to a known state for booting a provided Kernel. The Kernel is passed by writing the image to the node /proc/zboot.

zboot is the actual boot loader, the thing that gives you the prompt allowing you to select kernels etc. It is responsible for probing the disks, finding the first MBR with an OpenBSD partition carrying a root file system and acquiring the kernel from that file system. It uses zbsdmod to load that Kernel once it has been acquired.

-Andy
« Last Edit: August 24, 2006, 05:33:01 am by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Bsd Off An External Usb Hdd
« Reply #4 on: August 24, 2006, 09:01:41 am »
Say I wanted to install cacko in the flash area but wanted Openbsd to continue to autoload like it does now what would I have to change inorder to have the bootloader give me the option of booting cacko instead? What files would I need to edit?
« Last Edit: August 31, 2006, 05:26:43 pm by mathemajikian »

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Bsd Off An External Usb Hdd
« Reply #5 on: August 26, 2006, 05:09:41 am »
Quote
Say I wanted to install cacko in the flash area but wanted Openbsd to continue to autoload like it does now what would I have to change inorder to have the bootloader give me the option of booting cacko instead? What files would I need to edit?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=139650\"][{POST_SNAPBACK}][/a][/div]

Well, the OpenBSD boot loader won't specifically boot Linux for you, have a hunt around though, I think doing the IPK version of the install is going to suit your requirements somehow.

Basically I would suggest adding something conditional in the Zaurus boot that lets you select OpenBSD as a startup and have it conditionally insmod the module and run zboot if that option is selected.

Under Cacko you may want to take a look at /usr/sharp/etc/launch.conf and since Cacko doesn't have launch.default set to immediately select Qtopia from the launch.conf you can hit / to get the launch menu defined in launch.conf. Personally if I wanted a dual boot system this is probably where I would implement the selection.

-Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Bsd Off An External Usb Hdd
« Reply #6 on: August 26, 2006, 07:11:06 am »
So at boot up what files are used to launch the linux kernel which I have installed now? Once this kernel is loaded what files are used to inform it to load the zbsdmod? It would seem like there should be away to have it ask you if you want to load zbsdmod to boot BSD or to load cacko? How is cacko normally launched?

Zaurus bootloader: http://www.piro.hopto.org/~piro/zaurus/bootloader/

[img]http://www.piro.hopto.org/~piro/zaurus/bootloader/bootloader.JPG\" border=\"0\" class=\"linked-image\" /]
« Last Edit: August 31, 2006, 05:26:55 pm by mathemajikian »

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Bsd Off An External Usb Hdd
« Reply #7 on: August 26, 2006, 03:30:46 pm »
I figured it out. I  now have my full openbsd install on the internal hard drive with the option of booting into cacko at boot time! I will post the how to later tonight. The best news is that this process does not affect your existing BSD install!

EDIT: Heres the link to the text https://www.oesf.org/forums/index.php?showtopic=21249
« Last Edit: September 01, 2006, 10:26:15 am by mathemajikian »