2

I would like to learn how to write programs which may run without booting the operating system, like Norton Ghost or Paragon programs. I would like to be able to run the program from a CD or a USB stick.

Could you give me some pointers, please?

Pateman
  • 2,727
  • 3
  • 28
  • 43

2 Answers2

3

Basically - unless you use an existing one - you have to write your own operating system - it could be small, but it is an OS.

Writing it is a bit different from writing applications, because you have to interface with hardware directly (or through the BIOS). It requires a good knowledge of low-level programming, hardware devices specifications and processor architecture, especially if you need memory and have to switch a x86 processor to protected mode ("unreal mode" could be used, though) which uses a fairly complex mechanism. Some parts may need to be written in assembler to access the special "privileged" instructions used by "kernels" running at the most privileged level ("ring 0") in protected mode, and to handle interrupts.

You could start here http://wiki.osdev.org/Main_Page.

  • Or maybe tag along on something existing OS, like e.g. Steve Gibson does with this Spinrite app? - That uses FreeDOS to boot from CD. – Jan Doggen Feb 02 '12 at 15:35
  • If your main aim is to run an application from CD/USB then using an already available OS is the fastest way. But if someone has no pressing need and would like to learn how to write an OS from scratch, why not? Such kind of research is always istructive, and now VMs make it far easier. Using an already existing OS let you also use existing compilers to write the applications running on it, otherwise or you OS supports existing executable formats, or the next step is to write your own compiler ;) –  Feb 02 '12 at 20:25
2

Delphine is an attempt to write a primitive OS using freepascal. It is not an active project anymore, but code is there for you to try.

ClassiOS is an OS written in Delphi.

A more professional solution is to go for a win32 compatible OS like On Time RTOS-32, buy a license and make a bootable stick/CD program in Delphi. Note this an expensive solution, but used in lots of real-time critical systems. We implemented a more or less DOS clone used to boot any X86 system from a USB stick.

LU RD
  • 34,438
  • 5
  • 88
  • 296