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 6382075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:28:33+00:00 2026-05-25T02:28:33+00:00

I am trying to write the full OS independent program on C++. I want

  • 0

I am trying to write the full OS independent program on C++. I want to load the program just before booting up the OS (i.e. Windows). I tried to replace the MBR with my simple “Hello World” program, but nothing happens and I lost Partition table of Virtual Hard disk.
I think I should write the C++ compiler to the MBR to directly execute the program or source code.

Q. The Compiler is in EXE format so should require Windows or DOS. Does it can be written on MBR?

Q. The C++ program require DOS platform. Does it can be run without any OS?

I am trying to write a Boot loader and some same sort of programs.

  • 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-25T02:28:34+00:00Added an answer on May 25, 2026 at 2:28 am

    It is impossible to write such program in plain C/C++. There is no OS, and the compiler should work in “freestanding” mode. In this mode there is not “stdin.h” header, no files, no file access and no printf are available.

    So, you program should call BIOS functions directly, e.g. using asm keyword.

    Format of MBR binary is very close to COM file format of DOS. It is possible to convert short COM program into MBR boot code (by manipulating some parameters of compilation).

    Also, you should know that MBR is one sector long and it contains a partition table. So, you have only ~450 bytes to store binary code.

    • 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 full screen application for Windows CE 5.0. I'm using
I am trying to write a program in C language(code::blocks in windows). I have
I'm trying to write a simple, full text search with PHP and PDO. I'm
I'm trying to write a regex function that will identify and replace a single
I'm trying to write an application that controls the system volume on Windows 7
I am trying to write a simple bash script that will search for files
Trying to write a regex that can parse a full name and split it
I am trying to write a watermarking program with java , So I found
I'm trying to write a function to generate the full C# declaration for a
I'm trying to write a simple task using Maven: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.3</version> <executions> <execution>

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.