OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Jun 24, 2019 6:20 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: File system
PostPosted: Fri Jun 22, 2018 5:59 am 
Offline

Joined: Thu Mar 01, 2018 10:09 am
Posts: 13
I run the file system into ketu. Everything is working.
Code:
qemu-system-i386 -kernel kernel -hda hda.img

Code:
fs_init("/dev/hda"); // /dev/hda device name

Then I divided the flash drive into two partitions. At first I installed a grub2. The second one for files (ext2). But no device name can be seen. In ubuntu the second section as /dev/sdb2.
I do not know what to do, help please.


Top
 Profile  
 
 Post subject: Re: File system
PostPosted: Sat Jun 23, 2018 2:53 am 
Offline
Member
Member

Joined: Mon Jul 25, 2016 6:54 pm
Posts: 166
Location: Adelaide, Australia
You maybe need to give more info, but if your drive is not appearing in Ubuntu but you have a /dev/* entry for it, make sure it's getting mounted (entry in /etc/fstab for example). Linux expects all drives to be explicitly mounted.

Edit: Nevermind, I misread the question.


Last edited by StudlyCaps on Mon Jun 25, 2018 9:28 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: File system
PostPosted: Mon Jun 25, 2018 8:44 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7376
Location: Germany
If there is no file corresponding to the partition in /dev, you cannot mount it, because "mount" binds a device to a mount point. No device, no mounting.

I am not familiar with QEMU, but I notice that you are handling /dev/hda -- i.e., the whole hard drive. Partitions are numbered -- /dev/hda1, /dev/hda2. Now, it could be totally normal to call fs_init() on /dev/hda, or it could be that you are using the whole hard drive image as a partition, and that you don't have code in place for handling a device (which could hold multiple partitions) at all? (That is actually a rather common issue when using virtual computers -- using the whole disk like one partition. On real hardware, that simply wouldn't work.)

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 4 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