OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 10:53 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Anyone tried out their kernel on Intel Edison?
PostPosted: Mon Nov 10, 2014 3:19 pm 
Offline
Member
Member
User avatar

Joined: Sat Jul 07, 2007 7:49 pm
Posts: 131
Image

Mine just arrived today... Going to see if I can get it booting. Seems u-boot is the way to go.


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 11, 2014 3:10 am 
Offline
Member
Member

Joined: Thu May 28, 2009 2:41 pm
Posts: 70
Location: Germany
Did you just buy the CPU or did you buy a board, too? Which board did you buy?

It surely seems interesting. I'm thinking about getting one myself :)
Altough I've got no experience with arduino or alike :mrgreen:


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 11, 2014 3:25 am 
Offline
Member
Member
User avatar

Joined: Sat Jul 07, 2007 7:49 pm
Posts: 131
I bought this;

https://www.sparkfun.com/products/13025

and this

https://www.sparkfun.com/products/13097

to be sure....

The Edison has really two things inside;

1) Intel Quark microcontroller running at 100MHz. This is the part which runs the "Arduino" stuff...
2) Dual core Intel Atom at 500MHz. It includes a flash memory and ram. This means its basically a embedded PC. It lacks a 16-bit BIOS, so you are booting straight into 32-bit mode with the help from U-boot. Very similar to grub or uboot found on other hardware platforms.

There is also a DFU programming support and a FTDI (serial<->usb) onboard. That way you can access your device serial uart via your pc with a usb cable.

regards
Thomas


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 11, 2014 4:49 am 
Offline
Member
Member

Joined: Thu May 28, 2009 2:41 pm
Posts: 70
Location: Germany
I looked at some documents/tutorials and I'm wondering (altough I don't even own one yet :D ) how you'd flash anything on it other than Yocto.

As I understand it you write files into the flash memory just by moving those files onto the "Edison" drive (windows)?
This seems a little bit strange. What does the CPU execute first when it turns on?

How does it work that you just copy the files of Yocto on this drive and then you can just connect to Yocto on your Edison board via putty (COM port).

It seems there's some magic involved or my brain just can't figure out how this works.


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 11, 2014 5:17 am 
Offline
Member
Member
User avatar

Joined: Sat Jul 07, 2007 7:49 pm
Posts: 131
Quick explanation;

When the device powers on it loads a primary bootloader from flash. (Intel code).

This bootloader loads u-boot from flash emmc (The usb disk you see when you connect edison to a computer). Then u-boot loads whatever you tell it... Just copy your kernel to the disk and boot away... I think :lol:

From the usb serial port console on power-on the Edison:

Code:
******************************
******************************
PSH KERNEL VERSION: b0182727
                WR: 20104000
******************************

SCU IPC: 0x800000d0  0xfffce92c

PSH miaHOB version: TNG.B0.VVBD.0000000c

microkernel built 23:15:13 Apr 24 2014

******* PSH loader *******
PCM page cache size = 192 KB
Cache Constraint = 0 Pages
Arming IPC driver ..
Adding page store pool ..
PagestoreAddr(IMR Start Address) = 0x04899000
pageStoreSize(IMR Size)          = 0x00080000

*** Ready to receive application ***


U-Boot 2014.04 (Aug 20 2014 - 16:08:32)

       Watchdog enabled
DRAM:  980.6 MiB
MMC:   tangier_sdhci: 0
In:    serial
Out:   serial
Err:   serial

Hit any key to stop autoboot:  1 ... 0

boot >


Last edited by mutex on Tue Nov 11, 2014 6:01 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 11, 2014 5:28 am 
Offline
Member
Member

Joined: Thu May 28, 2009 2:41 pm
Posts: 70
Location: Germany
So the intel bootloader is hard coded to load/use u-boot?
You just copy u-boot and your kernel on the flash drive and configure u-boot to load your kernel and everything should be fine, right?

What's PSH-Kernel? Is this the bootloader from intel which loads u-boot?


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 11, 2014 5:33 am 
Offline
Member
Member
User avatar

Joined: Sat Jul 07, 2007 7:49 pm
Posts: 131
I guess you could replace u-boot with your own, but I'm not sure how it works. I guess the u-boot may be a ELF binary and that it jumps to the entry point... **not sure**

The PSH stuff is the Intel "hardcoded" bootloader. It's actually not hardcoded... Can also be replaced by connecting Edison in DFU mode and flashing it. Don't know if there is a "stage0" boot process that checks a signature or something. Intel can probably tell you that...

But u-boot works well. Does provide a useful environment for loading your kernel.

just "fatload mmc 0:7 0x1000000 yourkernel.img" and "go 0x1001000" or whatever...

I'll post a log from my experiment this evening.

regards
Thomas


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 11, 2014 12:00 pm 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 9:29 pm
Posts: 2426
Location: Canada
From what I can gleam from Google, there are actually 3 cores in the second generation Edison. A dual-core Atom, which runs Linux by default.. and a single core Intel Quark, running a proprietary RTOS based on VxWorks (..called ViperOS).

The Intel Quark core might be playing a role similar to the GPU in the Raspberry Pi, being initialized first and later bootstrapping the faster Atom cores.

_________________
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Thu Nov 13, 2014 10:15 pm 
Offline
Member
Member
User avatar

Joined: Sat Jul 07, 2007 7:49 pm
Posts: 131
Lack of documentation on the SoC made this a real pain.

My finding so far;

u-boot loading via emmc is simple. Just put the binary on the removable USB drive that shows up when you connect your computer to the USB OTG port and on the other USB console to u-boot just issue;

Code:
load emmc 0:9 0x100000 /kernel.img
go 0x100000


But doing that every time you need to test a new binary is painfull.

So i tried out serial loading of the kernel and it works pretty well (but slow).

Code:
loady 0x100000 115200


I then created a expect script on my host/build computer to upload the file with picocom and issue "go 0x100000" after its done. That worked well, but nothing happens on screen....! :?


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Thu Nov 13, 2014 10:32 pm 
Offline
Member
Member
User avatar

Joined: Sat Jul 07, 2007 7:49 pm
Posts: 131
A major research issue was finding out how to output on the UART. I was hoping my IO port based serial port code would work. That was not the case! Since I was unable to find any documentation on the SoC I had to do some digging...

I booted the Linux image that came with Edison and took a look at /proc/tty/drivers and /proc/tty/driver/* for the current tty. Tells me its a MFD serial port. A look in lspci gave me the clue. Its a PCI serial port.

I added the vendor/device to my PCI serial driver and rebooted since that should work..... [-o< Nothing! #-o

I tried to write directly to the address I found in lspci from u-boot... [-o< [-o<

Code:
boot>mw.b 0xff010180 0x21 1
!boot>


That works.. So since u-boot initialized the UART to 115200 and mapped the BAR i was good..

So I created a dumb driver in my kernel to handle that. So now it boots with messages. =D>

Problem is that kernel does not find the PCI devices except host bridge and graphics adapter... Why???

So I did some more digging with dmesg and lspci

Looks like the PCI config space is not IO mapped but MMIO mapped. That was new to me.... So now I'm writing a new PCI enumerator supporting memory mapped config space..

That took some time figuring out :lol:


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Mon Nov 17, 2014 9:39 am 
Offline
Member
Member

Joined: Thu May 28, 2009 2:41 pm
Posts: 70
Location: Germany
If you like you could add an article to our wiki in which you write about your experiences with Intel Edison.
How to start your OS with u-boot, how to write messages to the serial port and in general just some problems you encountered and how you solved them.

As I said I'm thinking about getting one myself but I think I wouldn't have been able to find out how to do those things on by myself. So I would be glad if such an article like mentioned above exists to help me get started :wink: :)


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Mon Nov 17, 2014 4:28 pm 
Offline
Member
Member
User avatar

Joined: Sat Jul 07, 2007 7:49 pm
Posts: 131
I'll create a short summary on the wiki.

The Edison firmware starts a watchdog thats a part of the SoC peripherals. If that's not kept alive or stopped your board will reset within a minute or so.

The chipset is undocumented (released end of Q4) so I had to do some digging again.

This will disable the watchdog from u-boot:

Code:
mw.l 0xff009000 0x10f8 1


This will perform a board reset from your kernel:

Code:
*((dword*)0xff009000) = 0xf3;


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 18, 2014 1:57 pm 
Offline
Member
Member

Joined: Wed Jul 18, 2007 5:51 am
Posts: 170
Why would anyone buy one of these Intel Edisons, when a Rasberry Pi is about HALF the price?
You can get Linux prebuilt for Rasberry Pi, it seems there is no Linux ready for Edison yet.
Rasberry is much better documented so OS Development must be easier on Raspberry.
mutex sounds like he is an Intel employee or shareholder.


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Tue Nov 18, 2014 3:22 pm 
Offline
Member
Member

Joined: Thu May 28, 2009 2:41 pm
Posts: 70
Location: Germany
For Intel Edison there's a linux distribution called Yocto which is available.
It's compatible with arduino and also: https://www.sparkfun.com/news/1603


Top
 Profile  
 
 Post subject: Re: Anyone tried out their kernel on Intel Edison?
PostPosted: Wed Nov 19, 2014 1:28 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
tom9876543 wrote:
Why would anyone buy one of these Intel Edisons, when a Rasberry Pi is about HALF the price?
How about comparing it slightly more fairly to a raspberry with a wifi dongle?

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Garnek0, SanderR and 52 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group