If you're using "count=1", you need to specify a block size and make sure that the files are smaller than the block size otherwise they will be truncated.bilsch01 wrote:The command lines for writing them to disk are:
dd if=/mnt/sda5/home/bilsch/jinx/bootn1.bin count=1 of=/dev/sda1 count=1
dd if=/mnt/sda5/home/bilsch/jinx/kern1.bin count=1 of=/dev/sda1 seek=1 count=1
load & execute next sector after bootsector
-
- Member
- Posts: 1146
- Joined: Sat Mar 01, 2014 2:59 pm
Re: load & execute next sector after bootsector
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Re: load & execute next sector after bootsector
dd uses a default block size of 512 bytes.
Re: load & execute next sector after bootsector
[/quote]Hint: it probably doesn't.[/quote]Have you confirmed that /dev/sda1 starts at LBA 1 and not somewhere else?
Yes. I corrected that. Sector to load is lba 64 not lba 2. I have the program running correctly now - Success. Onwards to writing a real bootsector and a format program. I,m going to model it on MSDOS. Thanks for your help. Bill S.
Last edited by bilsch01 on Tue Apr 19, 2016 5:08 pm, edited 1 time in total.
Re: load & execute next sector after bootsector
Both files are 512 bytes. Default bs is 512.onlyonemac wrote:If you're using "count=1", you need to specify a block size and make sure that the files are smaller than the block size otherwise they will be truncated.bilsch01 wrote:The command lines for writing them to disk are:
dd if=/mnt/sda5/home/bilsch/jinx/bootn1.bin count=1 of=/dev/sda1 count=1
dd if=/mnt/sda5/home/bilsch/jinx/kern1.bin count=1 of=/dev/sda1 seek=1 count=1
Re: load & execute next sector after bootsector
You really shouldn't hard code this value. Read the partition table to find where the partition starts.bilsch01 wrote:I corrected that. Sector to load is lba 64 not lba 2. I have the program running correctly now - Success. Onwards to writing a real bootsector and a format program.