Welcome! Log In Create A New Profile

Advanced

Is uBoot OS specific?

Posted by balanga 
Is uBoot OS specific?
June 14, 2017 05:25PM
I don'know anything about uBoot, and I'm not sure if my understanding of it as a Universal boot loader for embedded ARM systems is correct. If that is the case, then presumably the same uBoot can load any OS which works on the platform, not just Debian, but also ArchLinux and even (God forbid) Windows.

Is my understanding correct?
Re: Is uBoot OS specific?
June 14, 2017 05:34PM
balanga Wrote:
-------------------------------------------------------
> I don'know anything about uBoot, and I'm not sure
> if my understanding of it as a Universal boot load
> er for embedded ARM systems is correct. If that is
> the case, then presumably the same uBoot can load
> any OS which works on the platform, not just Debia
> n, but also ArchLinux and even (God forbid) Window
> s.
>
> Is my understanding correct?

u-boot will load and run virtually all Linux distros (Debian, Arch, Gentoo, Fedora ....). But not Windows.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
June 15, 2017 08:53AM
How about FreeBSD?
Re: Is uBoot OS specific?
June 15, 2017 11:17AM
yep
Re: Is uBoot OS specific?
June 16, 2017 04:38PM
Is there such a thing as a FreeBSD uBoot?
Re: Is uBoot OS specific?
June 16, 2017 04:49PM
balanga Wrote:
-------------------------------------------------------
> Is there such a thing as a FreeBSD uBoot?

No. U-Boot is not OS specific. How you configure envs settings to boot certain distro is what make it specific.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
June 19, 2017 10:30PM
feas Wrote:
-------------------------------------------------------
> yep


Does this mean you have or know someone who has FreeBSD working on a GoFlex Home unit?
Re: Is uBoot OS specific?
June 19, 2017 10:51PM
balanga Wrote:
-------------------------------------------------------
> feas Wrote:
> --------------------------------------------------
> -----
> > yep
>

yep was a simple answer to your question if u-boot would allow other OS's to load.

>
> Does this mean you have or know someone who has Fr
> eeBSD working on a GoFlex Home unit?

For this question a simple google search came up with this but I can't speak of it from experience.

https://cooltrainer.org/freebsd-kirkwood/building/
Re: Is uBoot OS specific?
June 20, 2017 12:17AM
balanga,

feas has covered the rootfs part.

Now the boot loader part is not comlicated. You have installed a new u-boot (mine or Arch does not matter), it will most likely boot FreeBSD rootfs with some simple changes in u-boot envs. But first I need to look at that the FreeBSD rootfs that you will have created, and give you something to try.

With that said, I would prefer that you boot in to Debian rootfs, and then update u-boot with my build so it will save me some time. But if you'd rather keep what you have then it is fine, too.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
June 20, 2017 02:54AM
bodhi Wrote:
-------------------------------------------------------
> balanga,
>
> feas has covered the rootfs part.
>
> Now the boot loader part is not comlicated. You ha
> ve installed a new u-boot (mine or Arch does not m
> atter), it will most likely boot FreeBSD rootfs wi
> th some simple changes in u-boot envs. But first I
> need to look at that the FreeBSD rootfs that you w
> ill have created, and give you something to try.
>
> With that said, I would prefer that you boot in to
> Debian rootfs, and then update u-boot with my buil
> d so it will save me some time. But if you'd rathe
> r keep what you have then it is fine, too.

I'm more than happy to try. I'm more comfortable with FreeBSD - even have it running on my Raspberry Pi, and the ultimate goal was to have a FreeBSD based GoFlex Home unit. So tell me what I need to do and I'll give it a try.
Re: Is uBoot OS specific?
June 20, 2017 03:04AM
balanga,

> So tell me what I need to do
> and I'll give it a try.

As I said, I need to look at that the FreeBSD rootfs that you have and give you something to try (I don't know what it looks like).

On the system that you have FreeBSD running,

dmesg
ls -l /
ls -lart /boot
ls -l /lib/modules

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
June 20, 2017 07:24AM
dmesg
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2016 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-CURRENT #0 r310476: Fri Dec 23 08:20:46 MST 2016
    brd@hive.raspbsd.org:/usr/local/raspbsd/obj/RPI2/obj/arm.armv6/usr/local/raspbsd/src/common/sys/RPI2 arm
FreeBSD clang version 3.9.1 (tags/RELEASE_391/final 289601) (based on LLVM 3.9.1)
WARNING: WITNESS option enabled, expect reduced performance.
VT: init without driver.
CPU: ARM Cortex-A7 r0p5 (ECO: 0x00000000)
CPU Features: 
  Multiprocessing, Thumb2, Security, Virtualization, Generic Timer, VMSAv7,
  PXN, LPAE, Coherent Walk
Optional instructions: 
  SDIV/UDIV, UMULL, SMULL, SIMD(ext)
LoUU:2 LoC:3 LoUIS:2 
Cache level 1:
 32KB/64B 4-way data cache WB Read-Alloc Write-Alloc
 32KB/32B 2-way instruction cache Read-Alloc
Cache level 2:
 512KB/64B 8-way unified cache WB Read-Alloc Write-Alloc
real memory  = 989851648 (943 MB)
avail memory = 952913920 (908 MB)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
random: entropy device external interface
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> mem 0x3f000000-0x3fffffff on ofwbus0
local_intc0: <BCM2836 Interrupt Controller> mem 0x40000000-0x400000ff on simplebus0
intc0: <BCM2835 Interrupt Controller> mem 0xb200-0xb3ff irq 4 on simplebus0
generic_timer0: <ARMv7 Generic Timer> irq 0,1,2,3 on ofwbus0
Timecounter "ARM MPCore Timecounter" frequency 19200000 Hz quality 1000
Event timer "ARM MPCore Eventtimer" frequency 19200000 Hz quality 1000
bcmwd0: <BCM2708/2835 Watchdog> mem 0x10001c-0x100027 on simplebus0
gpio0: <BCM2708/2835 GPIO controller> mem 0x200000-0x2000af irq 5,6,7,8 on simplebus0
gpio0: read-only pins: 46,48-53.
gpio0: reserved pins: 48-53.
gpiobus0: <OFW GPIO bus> on gpio0
gpioc0: <GPIO controller> on gpio0
bcmrng0: <Broadcom BCM2835 RNG> mem 0x104000-0x10401f irq 9 on simplebus0
iichb0: <BCM2708/2835 BSC controller> mem 0x205000-0x20501f irq 10 on simplebus0
iicbus0: <OFW I2C bus> on iichb0
iic0: <I2C generic I/O> on iicbus0
iichb1: <BCM2708/2835 BSC controller> mem 0x804000-0x80401f irq 11 on simplebus0
iicbus1: <OFW I2C bus> on iichb1
iic1: <I2C generic I/O> on iicbus1
spi0: <BCM2708/2835 SPI controller> mem 0x204000-0x20401f irq 12 on simplebus0
spibus0: <OFW SPI bus> on spi0
bcm_dma0: <BCM2835 DMA Controller> mem 0x7000-0x7fff,0xe05000-0xe05fff irq 13,14,15,16,17,18,19,20,21,22,23,24,25 on simplebus0
mbox0: <BCM2835 VideoCore Mailbox> mem 0xb880-0xb8bf irq 26 on simplebus0
sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0x300000-0x3000ff irq 27 on simplebus0
mmc0: <MMC/SD bus> on sdhci_bcm0
uart0: <PrimeCell UART (PL011)> mem 0x201000-0x201fff irq 28 on simplebus0
uart0: console (115200,n,8,1)
vchiq0: <BCM2835 VCHIQ> mem 0xb800-0xb84f irq 29 on simplebus0
vchiq: local ver 8 (min 3), remote ver 8.
pcm0: <VCHIQ audio> on vchiq0
bcm283x_dwcotg0: <DWC OTG 2.0 integrated USB controller (bcm283x)> mem 0x980000-0x99ffff irq 30 on simplebus0
usbus0 on bcm283x_dwcotg0
cpulist0: <Open Firmware CPU Group> on ofwbus0
cpu0: <Open Firmware CPU> on cpulist0
bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
cpu1: <Open Firmware CPU> on cpulist0
cpu2: <Open Firmware CPU> on cpulist0
cpu3: <Open Firmware CPU> on cpulist0
fb0: <BCM2835 VT framebuffer driver> on ofwbus0
fbd0 on fb0
VT: initialize with new VT driver "fb".
fb0: 1280x1024(1280x1024@0,0) 24bpp
fb0: fbswap: 1, pitch 3840, base 0x3d5b9000, screen_size 3932160
gpioled0: <GPIO LEDs> on ofwbus0
cryptosoft0: <software crypto>
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <DWCOTG OTG Root HUB> at usbus0
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
mmcsd0: 32GB <SDHC 00000 1.0 SN A011143E MFG 03/2015 by 27 SM> at mmc0 41.6MHz/4bit/65535-block
bcm2835_cpufreq0: ARM 600MHz, Core 250MHz, SDRAM 400MHz, Turbo OFF
Release APs
WARNING: WITNESS option enabled, expect reduced performance.
Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
uhub0: 1 port with 1 removable, self powered
warning: no time-of-day clock registered, system time will not be set accurately
ugen0.2: <vendor 0x0424 product 0x9514> at usbus0
uhub1: <vendor 0x0424 product 0x9514, class 9/0, rev 2.00/2.00, addr 2> on usbus0
uhub1: MTT enabled
uhub1: 5 ports with 4 removable, self powered
ugen0.3: <vendor 0x0424 product 0xec00> at usbus0
smsc0 on uhub1
smsc0: <vendor 0x0424 product 0xec00, rev 2.00/2.00, addr 3> on usbus0
random: unblocking device.
smsc0: chip 0xec00, rev. 0002
miibus0: <MII bus> on smsc0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on smsc0
ue0: Ethernet address: b8:27:eb:2c:a6:39
ugen0.4: <vendor 0x0000 USB OPTICAL MOUSE> at usbus0
ugen0.5: <NOVATEK USB Keyboard> at usbus0
ukbd0 on uhub1
ukbd0: <NOVATEK USB Keyboard, class 0/0, rev 1.10/1.12, addr 5> on usbus0
kbd1 at ukbd0
smsc0: chip 0xec00, rev. 0002
ue0: link state changed to DOWN
ue0: link state changed to UP
ums0 on uhub1
ums0: <vendor 0x0000 USB OPTICAL MOUSE, class 0/0, rev 1.10/1.00, addr 4> on usbus0
ums0: 3 buttons and [XYZ] coordinates ID=1
uhid0 on uhub1
uhid0: <NOVATEK USB Keyboard, class 0/0, rev 1.10/1.12, addr 5> on usbus0
lock order reversal:
 1st 0xd779fdb0 bufwait (bufwait) @ /usr/local/raspbsd/src/common/sys/kern/vfs_bio.c:3512
 2nd 0xc47d0400 dirhash (dirhash) @ /usr/local/raspbsd/src/common/sys/ufs/ufs/ufs_dirhash.c:281
stack backtrace:
lock order reversal:
 1st 0xc4f96a54 ufs (ufs) @ /usr/local/raspbsd/src/common/sys/kern/vfs_subr.c:2592
 2nd 0xd77b5e08 bufwait (bufwait) @ /usr/local/raspbsd/src/common/sys/ufs/ffs/ffs_vnops.c:277
 3rd 0xc4ec3a54 ufs (ufs) @ /usr/local/raspbsd/src/common/sys/kern/vfs_subr.c:2592
stack backtrace:
ugen0.5: <NOVATEK USB Keyboard> at usbus0 (disconnected)
ukbd0: at uhub1, port 3, addr 5 (disconnected)
ukbd0: detached
uhid0: at uhub1, port 3, addr 5 (disconnected)
uhid0: detached
ugen0.4: <vendor 0x0000 USB OPTICAL MOUSE> at usbus0 (disconnected)
ums0: at uhub1, port 2, addr 4 (disconnected)
ums0: detached

ls -l /
total 4209
-rw-r--r--   2 root       wheel         950 Dec 23 15:27 .cshrc
-rw-r--r--   2 root       wheel         242 Dec 23 15:27 .profile
drwxrwxr-x   2 root       operator      512 Dec 23 15:21 .snap
-r--------   1 root       wheel     4194304 Dec 23 15:21 .sujournal
-r--r--r--   1 root       wheel        6190 Dec 23 15:27 COPYRIGHT
drwxr-xr-x   2 root       wheel        1024 Dec 23 15:23 bin
drwxr-xr-x   9 raspberry  1001         1024 Dec 23 15:41 boot
dr-xr-xr-x  18 root       wheel         512 Jun 16 20:09 dev
-rw-r--r--   1 root       1001         4096 Jun 16 20:09 entropy
drwxr-xr-x  27 raspberry  1001         2560 Jun 16 20:12 etc
drwxr-xr-x   4 root       wheel        1536 Dec 23 15:24 lib
drwxr-xr-x   3 root       wheel         512 Dec 23 15:23 libexec
drwxr-xr-x   2 root       wheel         512 Dec 23 15:21 media
drwxr-xr-x   4 root       wheel         512 Jun 16 20:08 mnt
dr-xr-xr-x   2 root       wheel         512 Dec 23 15:21 proc
drwxr-xr-x   2 root       wheel        2560 Dec 23 15:23 rescue
drwxr-xr-x   6 root       wheel         512 Jun 20 11:59 root
drwxr-xr-x   2 root       wheel        2560 Dec 23 15:27 sbin
lrwxr-xr-x   1 root       wheel          11 Dec 23 15:27 sys -> usr/src/sys
drwxrwxrwt   8 root       wheel         512 Jun 20 03:41 tmp
drwxr-xr-x  15 root       wheel         512 Dec 23 15:29 usr
drwxr-xr-x  25 root       wheel         512 Jun 16 20:09 var
total 2164

ls -lart /boot
drwxr-xr-x   1 root       1001    16384 Jan  1  1980 msdos
-rw-r--r--   1 raspberry  1001      335 Apr 29  2015 loader.rc
drwxr-xr-x   2 root       wheel     512 Dec 23 15:21 firmware
drwxr-xr-x   2 root       wheel     512 Dec 23 15:21 modules
drwxr-xr-x   2 root       wheel     512 Dec 23 15:21 zfs
-r-xr-xr-x   1 root       wheel  403660 Dec 23 15:25 loader.efi
-r-xr-xr-x   1 root       wheel  101444 Dec 23 15:25 boot1.efi
-r--r--r--   1 root       wheel  819200 Dec 23 15:25 boot1.efifat
drwxr-xr-x   2 root       wheel     512 Dec 23 15:25 defaults
-r--r--r--   1 root       wheel    5858 Dec 23 15:25 menu.rc.sample
-r--r--r--   1 root       wheel    3550 Dec 23 15:25 beastie.4th
-r--r--r--   1 root       wheel    2802 Dec 23 15:25 brand.4th
-r--r--r--   1 root       wheel    2122 Dec 23 15:25 brand-fbsd.4th
-r--r--r--   1 root       wheel    6201 Dec 23 15:25 check-password.4th
-r--r--r--   1 root       wheel    1863 Dec 23 15:25 color.4th
-r--r--r--   1 root       wheel    4049 Dec 23 15:25 delay.4th
-r--r--r--   1 root       wheel    1486 Dec 23 15:25 efi.4th
-r--r--r--   1 root       wheel    4172 Dec 23 15:25 frames.4th
-r--r--r--   1 root       wheel    7494 Dec 23 15:25 loader.4th
-r--r--r--   1 root       wheel   16918 Dec 23 15:25 loader.help
-r--r--r--   1 root       wheel    3106 Dec 23 15:25 logo-beastie.4th
-r--r--r--   1 root       wheel    2632 Dec 23 15:25 logo-beastiebw.4th
-r--r--r--   1 root       wheel    2210 Dec 23 15:25 logo-fbsdbw.4th
-r--r--r--   1 root       wheel    2627 Dec 23 15:25 logo-orb.4th
-r--r--r--   1 root       wheel    2350 Dec 23 15:25 logo-orbbw.4th
-r--r--r--   1 root       wheel   36012 Dec 23 15:25 menu.4th
-r--r--r--   1 root       wheel    9256 Dec 23 15:25 menu-commands.4th
-r--r--r--   1 root       wheel   18593 Dec 23 15:25 menusets.4th
-r--r--r--   1 root       wheel    2671 Dec 23 15:25 screen.4th
-r--r--r--   1 root       wheel    2609 Dec 23 15:25 shortcuts.4th
-r--r--r--   1 root       wheel   36284 Dec 23 15:25 support.4th
-r--r--r--   1 root       wheel    3061 Dec 23 15:25 version.4th
drwxr-xr-x   2 root       wheel     512 Dec 23 15:29 dtb
drwxr-xr-x   2 root       1001    11776 Dec 23 15:29 kernel
-r--r--r--   1 root       wheel  283886 Dec 23 15:29 ubldr
-r--r--r--   1 root       wheel  231800 Dec 23 15:29 ubldr.bin
drwxr-xr-x   9 raspberry  1001     1024 Dec 23 15:41 .
-rw-r--r--   1 root       1001     4096 Jun 16 20:09 entropy
drwxr-xr-x  18 raspberry  1001     1024 Jun 16 20:09 ..

gpart show (equivalent to fdisk)

=>      63  62521281  mmcsd0  MBR  (30G)
        63    102375       1  !12  [active]  (50M)
    102438  62418906       2  freebsd  (30G)

=>       0  62418906  mmcsd0s2  BSD  (30G)
         0        90            - free -  (45K)
        90  62418816         1  freebsd-ufs  (30G)


This is from FreeBSD running on a Raspeberry Pi booted from a 32GB MicroSDHC card. There was no such directory as /lib/modules. Maybe what you want is called something else on FreeBSD. This will give you the layout of the filesystem on FreeBSD. Any applications which are not part of the core OS are installed under /usr/local

https://www.freebsd.org/cgi/man.cgi?hier(7)
Re: Is uBoot OS specific?
June 20, 2017 07:40AM
Re: Is uBoot OS specific?
June 20, 2017 04:25PM
balanga Wrote:
-------------------------------------------------------
> That should be:-
>
> https://www.freebsd.org/cgi/man.cgi?query=hier&man
> path=FreeBSD+6.1-RELEASE&format=html

That's interesting. But what you should do next is googling "FreeBSD u-boot" to find out how other people did this.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
June 20, 2017 05:33PM
To be quite honest, this is a very technical area, and most of the hits show pages which I don't understand. There are so many pages which span quite a period and relate to wide range of hardware that it is difficult to limit the search to my situation. I will study the link which you provided earlier and see if I can make anything of it,
Re: Is uBoot OS specific?
June 20, 2017 05:57PM
balanga Wrote:
-------------------------------------------------------
> To be quite honest, this is a very technical area,
> and most of the hits show pages which I don't unde
> rstand. There are so many pages which span quite a
> period and relate to wide range of hardware that i
> t is difficult to limit the search to my situation
> . I will study the link which you provided earlier
> and see if I can make anything of it,

There is really no hardware specifics in this. Basically you want to search for topics that peole discuss how to set up u-boot to boot FreeBSD. For example,

- Is the ubldr the boot file for FreeBSD?
- which file is FreeBSD kernel file?
- Where is the DTB? is it built in to BSD kernel file?

Things like that.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
June 29, 2017 08:36AM
https://cooltrainer.org/freebsd-kirkwood/installation/

Sounds easy enough, uboot basically has to load "kernel.bin" to RAM and then just execute it. You seem to have a file called "kernel" in your boot partition so I guess it's that the one in more modern FreeBSD.

for example (from serial console, if from linux use fw_setenv instead of setenv)

setenv bootcmd 'usb reset; fatload usb 0:1 0x900000 /boot/kernel; go 0x900000'

would set your device for looking into first partition of first usb device, which is formatted as FAT32, and load a file called kernel from inside the /boot folder, and then plain execute it.

You can also make something more complex as stated in the link above, if you want it to be able to find the right USB drive if you have more than one connected. Or boot from Sata drives, just write "ide" instead of "usb" in the line above.

Or you can keep the whole /boot folder as a separate partition on FAT32 if you want to keep your rootfs on UDF or whatever other filesystem. In that case change the "/boot/kernel" from above into "kernel", and add a line in FreeBSD's fstab to mount that partition over /boot folder.

The hard part seems to be getting a freebsd kernel/OS compiled for it.

EDIT: saw your posts on bsd forum, add
V=s
as an argument to your make. That is verbose mode. It will allow you to see what is going on, as long as it keeps spewing text it's probably still working.



Edited 3 time(s). Last edit at 06/29/2017 08:52AM by bobafetthotmail.
Re: Is uBoot OS specific?
July 19, 2017 05:57AM
bobafetthotmail Wrote:
-------------------------------------------------------
> https://cooltrainer.org/freebsd-kirkwood/installat
> ion/
>
> Sounds easy enough, uboot basically has to load "k
> ernel.bin" to RAM and then just execute it. You se
> em to have a file called "kernel" in your boot par
> tition so I guess it's that the one in more modern
> FreeBSD.
>
> for example (from serial console, if from linux us
> e fw_setenv instead of setenv)
>
> setenv bootcmd 'usb reset; fatload usb 0:1 0x90000
> 0 /boot/kernel; go 0x900000'
>
> would set your device for looking into first parti
> tion of first usb device, which is formatted as FA
> T32, and load a file called kernel from inside the
> /boot folder, and then plain execute it.
>
> You can also make something more complex as stated
> in the link above, if you want it to be able to fi
> nd the right USB drive if you have more than one c
> onnected. Or boot from Sata drives, just write "id
> e" instead of "usb" in the line above.
>
> Or you can keep the whole /boot folder as a separa
> te partition on FAT32 if you want to keep your roo
> tfs on UDF or whatever other filesystem. In that c
> ase change the "/boot/kernel" from above into "ker
> nel", and add a line in FreeBSD's fstab to mount t
> hat partition over /boot folder.
>
> The hard part seems to be getting a freebsd kernel
> /OS compiled for it.
>
> EDIT: saw your posts on bsd forum, add
> V=s
> as an argument to your make. That is verbose mode.
> It will allow you to see what is going on, as long
> as it keeps spewing text it's probably still worki
> ng.

I've had a bit of a break from my GFH project, but having just seen your post, I thought I'd resume... Firstly, I'd just like to mention that I'm rather out of my depth trying to do what I'd want, which is to run FreeBSD on my GoFlexHome unit... Having searched various forums, websites, mailing lists, it seems like solutions exist, but instructions are not always up to date, or unclear.. My experience so far as shown me how to replace the stock Seagate software, lock myself out, connect via a serial cable and unlock myself. All this thanks to help from bodhi on this forum and the FreeBSD forum.

Reading your post, I take it that my first task is to try and build a FreeBSD image using instructions here:-
https://cooltrainer.org/freebsd-kirkwood/building/
Unfortunately some of the instructions don't work and they are based on FreeBSD v8 and the current release is v11...but I'll see how far I can get. I expect it will take me a few days to get anywhere with it.
Re: Is uBoot OS specific?
July 19, 2017 07:38AM
balanga Wrote:
-------------------------------------------------------
> Reading your post, I take it that my first task is to try and build a FreeBSD image using instructions here:-
> https://cooltrainer.org/freebsd-kirkwood/building/
> Unfortunately some of the instructions don't work and they are based on FreeBSD v8 and the current release is v11...but I'll see how far I can get. I expect it will take me a few days to get anywhere with it.
>
If you are looking for the source code of a FreeBSD for Kirkwood, perhaps this GitHUB repo is what you need? Perhaps, you need to visit Building FreeBSD for Kirkwood discussion forum to learn more on how to build FreeBSD for a Kirkwood platform?
Re: Is uBoot OS specific?
July 19, 2017 01:48PM
habibie Wrote:
-------------------------------------------------------
> balanga Wrote:
> --------------------------------------------------
> -----
> > Reading your post, I take it that my first task
> is to try and build a FreeBSD image using instruct
> ions here:-
> > https://cooltrainer.org/freebsd-kirkwood/buildin
> g/
> > Unfortunately some of the instructions don't wor
> k and they are based on FreeBSD v8 and the current
> release is v11...but I'll see how far I can get. I
> expect it will take me a few days to get anywhere
> with it.
> >
> If you are looking for the source code of a FreeBS
> D for Kirkwood, perhaps this [url=https://github.c
> om/okeeblow/FreeBSD-kirkwood]GitHUB[/url] repo is
> what you need? Perhaps, you need to visit [url=htt
> ps://forums.freebsd.org/threads/61375]Building Fre
> eBSD for Kirkwood[/url] discussion forum to learn
> more on how to build FreeBSD for a Kirkwood platfo
> rm?

Actually, that is a thread I started.... Having looked at building FreeBSD today, it looks like the latest FreeBSD source (v11.0) includes all the necessary source and no patches are required, as far as I can tell. What I need to figure out now is to install FreeBSD on a USB stick and launch it from U-Boot. Not sure if need a different U-Boot...
Re: Is uBoot OS specific?
July 19, 2017 05:54PM
balanga,

>What I need to figure out now is to
> install FreeBSD on a USB stick and launch it from
> U-Boot. Not sure if need a different U-Boot...

I think you also need to verify which are the boot files on the FreeBSD rootfs. I briefly searched for this topic, and I can see that a "ubldr.bin" or something like that is used in booting. This is most likely because u-boot mainline does not deal with FreeBSD directly, but it can load a binary and run it. So the "ubldr.bin" is a FreeBSD loader.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
July 20, 2017 07:26AM
balanga Wrote:
-------------------------------------------------------
> Actually, that is a thread I started.... Having lo oked at building FreeBSD today, it looks like the latest FreeBSD source (v11.0) includes all the necessary source and no patches are required, as far as I can tell. What I need to figure out now is to install FreeBSD on a USB stick and launch it from U-Boot. Not sure if need a different U-Boot...
>
R U talking about this latest FreeBSD source?
Re: Is uBoot OS specific?
July 20, 2017 01:03PM
habibie Wrote:
-------------------------------------------------------
> balanga Wrote:
> --------------------------------------------------
> -----
> > Actually, that is a thread I started.... Having
> lo oked at building FreeBSD today, it looks like t
> he latest FreeBSD source (v11.0) includes all the
> necessary source and no patches are required, as f
> ar as I can tell. What I need to figure out now is
> to install FreeBSD on a USB stick and launch it fr
> om U-Boot. Not sure if need a different U-Boot...
> >
> R U talking about this [url=https://github.com/fre
> ebsd/freebsd]latest FreeBSD source[/url]?

No, I'm talking about the latest RELEASE version:-

[url]http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/11.0-RELEASE/src.txz[/url]

Using:-

make buildworld TARGET_ARCH=arm -DWITH_FDT
make buildkernel TARGET_ARCH=arm KERNCONF=DB-88F6XXX

Unfortunately I don't know how to launch this, so I can't test it.
Re: Is uBoot OS specific?
July 20, 2017 05:02PM
balanga,

> No, I'm talking about the latest RELEASE version:-
>
> http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/
> amd64/11.0-RELEASE/src.txz

Looks like x86 architecture, not ARM.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
July 20, 2017 10:05PM
bodhi Wrote:
-------------------------------------------------------
> balanga,
>
> > No, I'm talking about the latest RELEASE version
> :-
> >
> > http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/11.0-RELEASE/src.txz
>
> Looks like x86 architecture, not ARM.
>
It does appear so. But, it contains the source code of $FreeBSD: releng/11.0/README 300137 2016-05-18 10:43:13Z avos $
Re: Is uBoot OS specific?
July 21, 2017 07:43AM
There is also

http://ftp.freebsd.org/pub/FreeBSD/releases/arm64/11.0-RELEASE/src.txz

but it is the same file. There's only a single source tree.

Any suggestions as to what I should put in uEnv.txt to try and boot FreeBSD?

I've tried

uimage=/boot/kernel.bin

but get

reading /boot/kernel.bin
4408164 bytes read in 249 ms (16.9 MiB/s)
Booting from 0 ...
Wrong Image Format for bootm command


Where can I find a list of options which I can put in uEnv.txt?
Re: Is uBoot OS specific?
July 21, 2017 08:45AM
Re: Is uBoot OS specific?
July 21, 2017 02:17PM
bodhi Wrote:
-------------------------------------------------------
> balanga,
>
> >What I need to figure out now is to
> > install FreeBSD on a USB stick and launch it fro
> m
> > U-Boot. Not sure if need a different U-Boot...
>
> I think you also need to verify which are the boot
> files on the FreeBSD rootfs. I briefly searched fo
> r this topic, and I can see that a "ubldr.bin" or
> something like that is used in booting. This is mo
> st likely because u-boot mainline does not deal wi
> th FreeBSD directly, but it can load a binary and
> run it. So the "ubldr.bin" is a FreeBSD loader.

balanga,

Please read what I wrote above. bootm is for Linux.

You need to do more research and find out how people boot FreeBSD with u-boot. If you are not sure that you understand those instruction, then post them here. Perhaps I can help that way.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Is uBoot OS specific?
July 21, 2017 03:43PM
I thought that the easiest way to understand how things work and make some progress would be load a file over the network and execute it...

If I run DHCP, I retreive a file called gpxelinux.0. The system displays:-

TFTP fromserver 192.168.1.2; our IP address is 192.168.1.47
Filename 'gpxelinux.0'
Load address: 0x810000
Loading: ########
5.3 MiB/s
done
Bytes transferred = 111334 (1b2e6 hex)
GoFlexHome>

What I thought I should be able to do was run this program using

go 0x810000

I get

## Starting application at 0x00810000

and then nothing. Not sure if what I'm attempting makes any sense or what myresults show...
Re: Is uBoot OS specific?
July 21, 2017 10:39PM
balanga Wrote:
-------------------------------------------------------
> Reading your post, I take it that my first task is to try and build a FreeBSD image using instructions here:-
> https://cooltrainer.org/freebsd-kirkwood/building/
> Unfortunately some of the instructions don't work and they are based on FreeBSD v8 and the current release is v11...but I'll see how far I can get. I
> expect it will take me a few days to get anywhere with it.
>
I did some googling and foudn this How to build a FreeBSD toolchain for Linux and don't know if this may help or not. I basically is aguide on how to create a FreeBSD toolchain (v10) for Linux platform. once you have such a toolchain, perhaps building a FreeBSD will become more obvious?
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: