Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6245379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:29:39+00:00 2026-05-24T12:29:39+00:00

Im trying to write a bootloader for a Hobby OS and have it working

  • 0

Im trying to write a bootloader for a Hobby OS and have it working great.
Nothing Special, just prints a line of text:

BITS 16
ORG 0

start: jmp main


OEM         db "Test OS "           
BytesPerSector:     DW 512
SectorsPerCluster:  DB 1
ReservedSectors:    DW 1
NumberOfFATs:   DB 2
RootEntries:    DW 224
TotalSectors:   DW 2880
Media:      DB 0xf8  
SectorsPerFAT:  DW 9
SectorsPerTrack:    DW 18
HeadsPerCylinder:   DW 2
HiddenSectors:  DD 0
TotalSectorsBig:    DD 0
DriveNumber:        DB 0
Unused:         DB 0
ExtBootSignature:   DB 0x29
SerialNumber:   DD 0xa0a1a2a3
VolumeLabel:    DB "HOBBY  OS  "
FileSystem:         DB "FAT12   "



main:
    ;Adjust code Seg.
    cli
    mov ax, 0x07c0
    mov ds, ax
    mov es, ax
    mov fs, ax
    mov gs, ax
    ;Set up Stack
    mov ax, 0x0000
    mov ss, ax
    mov sp, 0xFFFF
    sti

    mov si, msg
    call print

print:

    .charLoop:

        lodsb
        or al,al
        jz .done
        mov ah, 0x0E
        int 0x10
    .done
        ret

msg db "Hello World",13,10,0

Im compiling with

nasm -f bin loader.asm -o loader.bin
dd if=loader.bin of=floppy.img bs=512 count=1 seek=0

I’ve read that the first 446 bytes are the boot code and bytes 447 – 509 is the partition table.
I tried then using:

dd if=loader.bin of=floppy.img bs=446 count=1 seek=0

to try to prevent the partition table from being overwritten but still no cigar.

Im using a Mac with OSX and Testing the OS with VirtualBox

I can run the floppy.img in VBox and the code works fine, but when I try to install the bootloader onto a FAT 16 Formatted disk, OSX can’t seem read the disk image any more as if it became unformatted.

The exact message out of disk utility is Unable to attach image "floppy.img."(No Mountable File Systems) Even though I just formatted the disk with a FAT 16 file system.

Unfortunatly since this is my first post, I can’t give you a picture.

I would really appreciate any help. Disk structure really isn’t my forte.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:29:41+00:00Added an answer on May 24, 2026 at 12:29 pm

    When you’re using dd, try adding the conv=notrunc option. This forces it to not try to truncate the file, but rather, just overwrite the parts you specified.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying write a query to find records which don't have a matching record
Im trying to write something to get my images to show correctly. I have
Trying to write a trivial application, But I have stuck into one of the
In trying to write more testable Java code, I have been using the Model-View-Presenter
Trying to write such function. It must divide text into multiple columns and the
Trying to write a PowerShell cmdlet that will mute the sound at start, unless
Trying to write a couple of functions that will encrypt or decrypt a file
Im trying to write a single byte at a certain location in a file.
im trying to write an app that will display a list off lines from
Im trying to write a function for adding category: function addCategory() { $cname =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.