Giter Site home page Giter Site logo

Comments (9)

SamyPesse avatar SamyPesse commented on June 1, 2024

No it's not, it's the offset of the first partition: https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System/blob/master/Chapter-3/README.md#create-a-disk-image-for-our-kernel-and-grub

from how-to-make-a-computer-operating-system.

akkartik avatar akkartik commented on June 1, 2024

Thanks. But I'm still confused: why isn't the offset 0? Why do we have to use the computation in your link?

I also am trying to go over the computation at your link. Locally, the output of fdisk -l -u c.img:

Disk sdk/c.img: 2 MB, 2097152 bytes
1 heads, 5 sectors/track, 819 cylinders, total 4096 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9cbdff7d

    Device Boot      Start         End      Blocks   Id  System
sdk/c.img1   *           1           4           2   83  Linux

On the VM:

You must set cylinders.
You can do this from the extra functions menu.

Disk c.img: 0 MB, 0 bytes
1 heads, 5 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9cbdff7d

Device Boot      Start         End      Blocks   Id  System
c.img1   *           1           4           2   83  Linux

I see where these show the size of each sector, but not where the 63 comes from. From http://en.wikipedia.org/wiki/Cylinder-head-sector#Sectors I learn that PCs usually have 63 sectors per track. Is that it?

from how-to-make-a-computer-operating-system.

SamyPesse avatar SamyPesse commented on June 1, 2024

Did you change the disk geometry for your c.img1? or do you use the same geometry of c.img?

The offset is not 0 because the partition starts after some boot sectors.

from how-to-make-a-computer-operating-system.

akkartik avatar akkartik commented on June 1, 2024

I didn't mean to change the geometry, I think I used the same geometry. And oddly enough the one with the 'must set cylinders' message is what shows hello correctly.

from how-to-make-a-computer-operating-system.

SamyPesse avatar SamyPesse commented on June 1, 2024

Hum, in vagrant I have:

vagrant@lucid32:/vagrant/sdk$ fdisk -l -u c.img
You must set cylinders.
You can do this from the extra functions menu.

Disk c.img: 0 MB, 0 bytes
16 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe8c36f7f

Device Boot      Start         End      Blocks   Id  System
c.img1   *          63        4031        1984+  83  Linux

Locally what os are you using? do you have the same thing with vagrant?

from how-to-make-a-computer-operating-system.

akkartik avatar akkartik commented on June 1, 2024

Host OS: Ubuntu 12.04.1
Vagrant OS: Ubuntu 10.04.4

Hmm, I installed vagrant from apt-get. Is this a problem?

from how-to-make-a-computer-operating-system.

mk270 avatar mk270 commented on June 1, 2024

I have different results in Vagrant from when running on bare metal.

from how-to-make-a-computer-operating-system.

liuluheng avatar liuluheng commented on June 1, 2024

I have got the same message

16 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes

but why 0 cylinders?

from how-to-make-a-computer-operating-system.

vpereira avatar vpereira commented on June 1, 2024

just something from fdisk:

the -u option, should receive the format wanted. The default is set if just "-u" is given. The default is different in different OS or Linux flavors. To avoid it you should use:

/sbin/fdisk -u=cylinder ...

from how-to-make-a-computer-operating-system.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.