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

  • Home
  • SEARCH
  • 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 9122357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:05:02+00:00 2026-06-17T06:05:02+00:00

I am trying to write a multi stage boot loader using NASM and gcc.

  • 0

I am trying to write a multi stage boot loader using NASM and gcc.
For this purpose I am referring grub boot loader source.

I have written a stage1 loader, but stuck at over writing partition
tables of MBR.

In grub stage1.S, they are using code like this to skip partition tables:

. = _start + STAGE1_PARTEND
.word   STAGE1_SIGNATURE

How can I do that in NASM?.

using times it will over write the partition tables.

So please help me.

  • 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-06-17T06:05:04+00:00Added an answer on June 17, 2026 at 6:05 am

    Assigning a value to . is treated the same as a .org directive

    (see this page).

    Thus, the code you pasted is changing the current origin to _start + STAGE1_PARTEND and placing a word with the value STAGE1_SIGNATURE there.

    So in NASM code you should be able to do something like:

    fill: times _start+STAGE1_PARTEND-$ db 0
    dw    STAGE1_SIGNATURE
                         ; .word is 16 bits on x86 (regardless of .code16 / .code64)
    

    Also see this example in the NASM manual showing how to pad a BIOS boot sector this way, as a replacement for MASM-style org or GAS-style . = new_position actually seeking and filling with padding in a flat binary output file.

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

Sidebar

Related Questions

I'm trying to write a multi-file patch for an open-source project, but the master
i have created a multi-module maven project and i am trying to write and
I am trying to write a JS validation function for multi-select listboxes. I have
Using Zend DB. I am trying to figure out how to write this query
I am trying to write a regex (in JavaScript) that will match a multi
I'm trying to write rts-like-tile-based game using Tiled and slick2d. I don't know how
I am trying to write my first true multi layered application and I was
I'm trying to write a Java method to preform a multi-pop off a stack.
I am trying to output a multi-line string to a file using FileWriter. How
I'm trying to write an editor overtop a multi-threaded game engine. In theory, through

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.