Welcome! Log In Create A New Profile

Advanced

ls, cat, vi

Posted by balanga 
ls, cat, vi
July 27, 2017 02:03AM
I'm trying to get a better idea about the way uBoot works and have yet to figure out how the filesystem works. Hopefully some can give me some guidance.... For instance, how can I see what devices or files are available and how to view them. Are there uBoot versions of Unix commands like ls,cat, vi, lsblk?
Re: ls, cat, vi
July 27, 2017 04:58AM
The u-boot website has all the info you might want.

http://www.denx.de/wiki/U-Bootdoc/BasicCommandSet

They also have a mailing list that may help with specific questions.

https://lists.denx.de/listinfo
Re: ls, cat, vi
July 27, 2017 05:39AM
feas Wrote:
-------------------------------------------------------
> The u-boot website has all the info you might want
> .
>
> [url=http://www.denx.de/wiki/U-Bootdoc/BasicComman
> dSet]http://www.denx.de/wiki/U-Bootdoc/BasicComman
> dSet[/url]


Thanks, I've already looked at that but there isn't much in the way of examples. For instance

ls
ls -list files in a directory (default /)

Usage:
ls <interface> [<dev[:part]> [directory]]
- List files in directory 'directory' of partition 'part' on
device type 'interface' instance 'dev'

I don't know which directories, partitions, interfaces or devs I have and don't know how to find out.

Most of the commands I try have similar cryptic instructions.

> They also have a mailing list that may help with s
> pecific questions.
>
> [url=https://lists.denx.de/listinfo]https://lists.
> denx.de/listinfo[/url]
Re: ls, cat, vi
July 27, 2017 05:53AM
balanga Wrote:
-------------------------------------------------------
> feas Wrote:
> --------------------------------------------------
> -----
> > The u-boot website has all the info you might wa
> nt
> > .
> >
> > [url=http://www.denx.de/wiki/U-Bootdoc/BasicComm
> an
> > dSet]http://www.denx.de/wiki/U-Bootdoc/BasicComm
> an
> > dSet[/url]
>
>
> Thanks, I've already looked at that but there isn'
> t much in the way of examples. For instance
>
> ls
> ls -list files in a directory (default /)
>
> Usage:
> ls <interface> [<dev[:part]> [directory]]
> - List files in directory 'directory' of part
> ition 'part' on
> device type 'interface' instance 'dev'
>
> I don't know which directories, partitions, interf
> aces or devs I have and don't know how to find out
> .
>
> Most of the commands I try have similar cryptic in
> structions.
>
> > They also have a mailing list that may help with
> s
> > pecific questions.
> >
> > [url=https://lists.denx.de/listinfo]https://list
> s.
> > denx.de/listinfo[/url]

a quick google search yielded

[url=https://www.google.com/search?q=uboot+ls&ie=utf-8&oe=utf-8]https://www.google.com/search?q=uboot+ls&ie=utf-8&oe=utf-8[/url]

and first result

[url=http://www.compulab.co.il/utilite-computer/wiki/index.php/Utilite_U-Boot_User_How-To%27s]http://www.compulab.co.il/utilite-computer/wiki/index.php/Utilite_U-Boot_User_How-To%27s[/url]
Re: ls, cat, vi
July 27, 2017 06:44AM
Thanks.The mist is beginning to clear now :)

I need
usb start
ls usb 0
load usb 0 00000000 $filename
go 00000000

to see what files I have and then load and run $filename at 00000000

Just need to work out which location I should load and run $filename.

Now I need a simple program compiled for ARM to see if it works.
Anyone know where I can download a 'hello, world' program?
Re: ls, cat, vi
July 27, 2017 06:50AM
balanga Wrote:
-------------------------------------------------------
> Thanks.The mist is beginning to clear now :)
>
> I need
>
> usb start
> ls usb 0
> load usb 0 00000000 $filename
> go 00000000
>
>
> to see what files I have and then load and run $fi
> lename at 00000000
>
> Just need to work out which location I should load
> and run $filename.
>
> Now I need a simple program compiled for ARM to se
> e if it works.
> Anyone know where I can download a 'hello, world'
> program?

https://www.raspberrypi.org/learning/demo-programs/
Re: ls, cat, vi
July 27, 2017 08:30AM
I've written my 'hello world' program on my Raspberry Pi now, and I can access it on my USB stick through my serial connection.

All that is left is to run it. I assume I nead to 'load' and then 'go', but at what address?
Re: ls, cat, vi
July 27, 2017 10:29AM
balanga Wrote:
-------------------------------------------------------
> I've written my 'hello world' program on my Raspbe
> rry Pi now, and I can access it on my USB stick th
> rough my serial connection.
>
> All that is left is to run it. I assume I nead to
> 'load' and then 'go', but at what address?

I think you are getting way ahead of yourself here. You need to do a lot of reading/research before you try and mess with your u-boot as you risk bricking your device. I don't think this is really the place to do that. With that being said here is a good overview for you on u-boot https://github.com/umiddelb/armhf/wiki/Get-more-out-of-%22Das-U-Boot%22 but the u-boot website I provided before is the place to be to learn about it.

You have identified previously that "hello world" was not included in your u-boot version. Running the "hello world" shell script for the raspberry pi is not the same. You can write a "hello world" program in any programing language but it does not mean you can just load it up into your embedded devices memory and run it. Your u-boot has different programs and settings loaded into it's limited memory at certain places that account for size so as to not overwrite the other and to fit within the limited space. The address where these programs and setting are loaded vary greatly from device to device as well as on the same devices with different versions of the programs loaded and need to be accounted for.

I am not trying to tell you you can't pursue learning about it but that you are far from being able to simply load stuff into your device and running it so please read all that you can from the previous sources provided and do some google-fu to learn more. Honestly, I am surprised you have chosen to run BSD as your OS as I would think doing so would require a fairly higher level of experience with unix type systems than just running a linux desktop like Ubuntu. It seems you have run into problems with trying to get some of the tools needed to safely test a newer u-boot from running a BSD system.

I have been using unix/linux for quite awhile and consider myself fairly competent with figuring things out and or solving issues but still suffer some serious brain farts at times and am a far ways away from the developers found here working to get all of these devices up and running for us. I have messed around with compiling u-boot and selecting different features but have always used kwboot to temporarily boot a new uboot so as not to overwrite the memory on the device for if it fails. So please don't do anything after you have read up on uboot without kwboot or a BSD variant if there is a separate but similar program.


EDIT:
Wanted to add since this is the internet and tones are not conveyed and can be hard to interpret that I truly mean this in a friendly advise way.



Edited 1 time(s). Last edit at 07/27/2017 01:04PM by feas.
Author:

Your Email:


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: