Comments (9)
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.
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.
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.
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.
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.
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.
I have different results in Vagrant from when running on bare metal.
from how-to-make-a-computer-operating-system.
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.
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)
- change wording in readme.md
- Error in downloading Ubuntu lucid32 HOT 9
- Why I cannot see Chapter 10, 11, 12.....?
- Error downloading files. HOT 2
- How-to-Make-a-Computer-Operating-System-ZH-CN
- Could not print userland "hello world !“ in qemu-system-i386.exe
- Vagrant failed
- why my lucid32 cannot install tools like nasm, make, build-essential, grub and qemu?? HOT 1
- vagrant fail to provision the machine HOT 2
- where tf is the actual coding instructions HOT 4
- Where are PDF, Mobi and ePub versions? HOT 1
- Can I use the operating system now? HOT 1
- vagrant up Command error HOT 1
- Why is there so much virtual environments? HOT 2
- fatal: more than one output file specified: arch/x86/start.o HOT 1
- Rewritten Book for Architecture RISC-V
- Undefined reference error on deleting objects HOT 1
- Chapter-2:make run have problem HOT 3
- How to install the 'make' ? HOT 1
- How can I 'make run' correctly? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from how-to-make-a-computer-operating-system.