Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syllable on usb hard drive

 
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop
View previous topic :: View next topic  
Author Message
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Wed Apr 15, 2015 7:21 am    Post subject: Syllable on usb hard drive Reply with quote

Just playing seeing how far I can get. Kaj I know your busy I am not expecting you to stop what your doing and look into anything.

I have got a bit of a workaround to install Syllable onto a usb hard drive. I read usb's are formatted in the same way as hard drives in regard to sectors. So I installed to an old IDE drive I had lying around (< 4Gb partition just for testing ) in my computer and made sure that booted into Syllable 0.6.7. Take the hard drive out and stick it into a usb enclosure and boot usb and you arrive at grub but I am failing to boot into Syllable.

grub seems to have loaded the file system.
bash at the grub prompt

grub< find /boot/grub/stage1 returns (hd0,0)
grub< root (hd0,0) returns file system type is afs partition type is 0x2a

kernel /system/kernel.so root=/dev/disk/ata/hda/0
dropping the path out of the line and changing it to point to the file system on (hd0,0)
kernel /system/kernel.so root=(hd0,0)
will tend to move the error away from can not mount the afs file system to can not mount device.

Onto more testing Very Happy
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Wed Apr 15, 2015 1:19 pm    Post subject: Reply with quote

That's a great experiment.

The guy in the old thread here said the kernel loads the USB drivers too late to boot from it.
Back to top
View user's profile Send private message Visit poster's website
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Thu Apr 16, 2015 1:40 am    Post subject: Reply with quote

[quote="Kaj"]
The guy in the old thread here said the kernel loads the USB drivers too late to boot from it.[/quote]

I am not so sure there is a boot from usb device option in the grub menu for Syllable.
When you start to believe your are in the partition reading the file system as you boot from the usb drive. File not found accurately means what it saids ( funny that ) Syllable 0.6.7 is missing a file under the hcd directory that the menu option is pointing to usb_ehci I think it is but its on the 0.6.6 under boot/system/ can't remember the rest I will file a bug report . However when I copied it over to my drive and then rebooted with the usb device option Syllable booted right up to when the usb device decided to claim the partition I was booting from.

http://jazzrus.com/pictures/usb/usbclaimsdrive.jpg
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Thu Apr 16, 2015 1:57 pm    Post subject: Reply with quote

There is no option in the boot menu to boot from a USB hard disk because it doesn't work, only from USB CD.

It's still interesting that you get that far. Apparently, GrUB loads enough through its standard interfaces to get the kernel and some drivers going. Then the USB drivers that are there for CD support take the hard disk, but it's too late to complete booting from it.

It's only a small thing that is missing in the kernel.
Back to top
View user's profile Send private message Visit poster's website
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Fri Apr 17, 2015 1:13 am    Post subject: Reply with quote

I am wondering about the device claimed by usb driver on the partition I am booting from. In one sense I am booting on the usb to load drivers for the usb I am booting on. To my way of thinking you would need to be off the partition before the usb driver tried to claim it. Syllable live cd has a ram disc, early linux live cd's also used to have ram discs. I am guessing that could get them off the cd before they reclaim the cd device.

Linux can boot off usb no problems so I wanted to check if they might have some ram disc capacity So i did a little bit of searching with regards to linux and ramdisk

initrd
(initial ramdisk) is a scheme for loading a temporary root file system into memory, which may be used as part of the Linux startup process.

Because there is no hard drive in many embedded systems based on Linux, the initrd also serves as the permanent root file system

Some Linux distributions such as Debian will generate a customized initrd image which contains only whatever is necessary to boot some particular computer, such as ATA, SCSI and filesystem kernel modules. These typically embed the location and type of the root file system.

and then the linux kernel also has initramfs

Modern computer bios seems to be putting us into the file system of a usb device with Syllable. I am not sure about Syllable boots processes but if everything could be loaded to a ram disc before booting the kernel. I wonder if a late call in the kernel to loading usb drivers would then matter and I am not saying a ram disc is the answer it just where my logic took me.

I think I am done testing 0.6.7 that seems like a blocker to me but I should do some testing on the live cd to see if that can boot off flash. Very Happy
Back to top
View user's profile Send private message
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Fri Apr 17, 2015 5:55 am    Post subject: Reply with quote

Reading over my posts again I feel like I am taking in nonsensical jiberish when I add an opinion to what I am seeing. I find it better to post pics so you can see what I am seeing and ignore the opinion type stuff. Very Happy
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Fri Apr 17, 2015 4:13 pm    Post subject: Reply with quote

It's not so bad. Smile

The first stages of booting must indeed go through a primitive data block that the BIOS can load. This by nature has the form of a primitive RAM disk. In Syllable it doesn't work exactly the same as initrd on Linux, but the first stages are necessarily the same: what the BIOS supports. If the BIOS can boot from a USB hard disk, which is similar to booting from USB CD, it can get fairly far on its own. But after that, GrUB must take over, and then Syllable, with its own USB drivers.
Back to top
View user's profile Send private message Visit poster's website
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Sat Apr 18, 2015 8:29 am    Post subject: Reply with quote

Just some house keeping as I am done testing. Like I said earlier Kaj I know your busy so I am not expecting you to look into this. Just hoping to provide some information for down the road.

There seems to be a slight dynamic quality to the module order that you list in grub. I tried deleting a line that would cause an error while booting and then placing modules above and below it so it acted like a poor man's breakpoint. I could move that error around slightly while booting. Thou what is much more static obviously is the calls to the drivers. My usb seems to be always mapped by Syllable after the call to map the boot file system. I had a bit of a look at source in 2 files.

init.c
char *azDevs[] = { "/dev/disk/ata", "/dev/disk/scsi", NULL };
for ( int n = 0; azDevs[n] != NULL; n++ )
..........
if ( sDiskDirEnt.d_name[0] != 'c' ) /* Ignore any drives which are not CD's */

The Ignore any drives which are not CD's is interesting could be a sanity check for a couple of issues in the usb driver (I don't know)

The device.c files kind of points to things being not that simple.
//****************************************************************************/
/** Initialize all devices after the root volume has been mounted.
* \internal
* \ingroup Devices
* \author Arno Klenke ([email protected])
*****************************************************************************/
void init_devices( void )
{
/* Iterate over /dev/bus to load the busmanager drivers */
iterate_directory( "/dev/bus", false, dummy, NULL );

/* Iterate over /dev/hcd to load the hostcontroller drivers */
iterate_directory( "/dev/hcd", false, dummy, NULL );

and of course there could be other files linking in.

Before I stop what I have been doing I thought I should uploaded a video of Syllable booting off usb. It's is a little bury over the quicker parts but you might be able to pause some sections of what it is doing. I also thought when the usb device claim the partition I was booting from the kernel was locked but it is not the kernel is alive.

So I have hope nobody is going to take this away from me (cause you programmers can kick my ass ) but I am going to claim ( since the kernel is alive) that I am the first person to boot Syllable of usb hard drive all be it with a huge bug like it's not mounting it boot file system.

jazzrus.com/pictures/usb/syllableusbboot.mp4

Very Happy
Back to top
View user's profile Send private message
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Sat Apr 18, 2015 8:40 am    Post subject: Reply with quote

Strange on checking my upload the video will launch and play in my browser but when I download it won't. I will leave it up for the moment and upload a zip file and check that.
Back to top
View user's profile Send private message
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Sat Apr 18, 2015 9:56 am    Post subject: Reply with quote

Ok I think that's better I will leave both links up for the moment because the reason I am claiming the kernel has loaded and part of it is alive and running is in the video. Very Happy

jazzrus.com/pictures/usb/syllableusbboot.zip
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Sat Apr 18, 2015 3:43 pm    Post subject: Reply with quote

Claim staked. Smile

The video is huge and overloads my machine.

init.c definitely needs to be modified for booting from USB disk.
Back to top
View user's profile Send private message Visit poster's website
nos



Joined: 17 Sep 2007
Posts: 95

PostPosted: Sat Apr 18, 2015 5:22 pm    Post subject: Reply with quote

Doing video in obviously not another strong point of mine either (sigh). Trusty convert option of VLC to my rescue. Video re-uploaded to both links. Plays much better now.

jazzrus.com/pictures/usb/syllableusbboot.mp4

jazzrus.com/pictures/usb/syllableusbboot.zip
Back to top
View user's profile Send private message
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2207
Location: Friesland

PostPosted: Sat Apr 18, 2015 8:34 pm    Post subject: Reply with quote

I can view the video now.

The BIOS can boot from USB, and GrUB can read AFS, so together they load the kernel and the drivers listed in the GrUB menu.

Then at about 15 seconds, Syllable says it can't mount the boot file system. So it fails to do what GrUB did before it, and it can't continue.

Because GrUB already loaded the USB drivers, it is still responding to new USB devices. The issue is fixing the boot sequence in the kernel and then init.c. It's already close.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group