Build a self-built Operating System Environment

Source: Internet
Author: User

1. Install Virtual PC ),

My is: http://www.crsky.com/soft/759.html

The downloaded version is virtual PC 2007 SP1 v6.0.192.0.

 

2. Install MS-DOS

My is: http://www.onlinedown.net/soft/2465.htm

My downloaded version is: MS-DOS 7.10

However, during the installation process, I found that this version is a virtual floppy disk and has two virtual floppy disks. During the installation process, the virtual PC cannot be switched out and the second virtual floppy disk is loaded, although installed on the first disk can also be used, but some additional functions such as, HD-COPY, etc. not installed, the total feeling is not steadfast, so downloaded a virtual optical drive version.

My is: http://help.cn-dos.net/soft/dos71cd.zip

My downloaded version is: MS-DOS 7.10

 

In virtual PC 2007, DOS Virtual Machine additions like earlier versions are unavailable. therefore, shared folders cannot be used after the Virtual DOS system is installed on VFD. Here, we can use dos Virtual Machine additions in Virtual PC 2004. VFD. I had to download another virtual PC 2004, find out the DOS Virtual Machine additions. VFD after installing it on other machines.

Choose Virtual Machine> floppy> capture floppy disk image and select dos Virtual Machine additions. VFD.

Restart the DOS Vm and switch to:

Run a:/dosadd. bat
The dos additional module will install the following three files on your VM.
Fcmd.exe
CDROM. sys
Idle.com

Restart the DOS Vm and run fshare. EXE in C:/vmadd.

Set shared folders in Virtual PC settings

[Note] If you use the memory extension umb (emm386) during installation, an error will be reported when running some programs, so block it.

Specific Method: Comment out emm386 in C:/config. sys in DOS, that is

Rem device = C:/dos71/emm386.exe noems. Restart the VM.

 

3. Assembly Language compiler

My is: http://sourceforge.net/project/showfiles.php? Group_id = 6208

The downloaded version is dos 32-bit binaries 2.03.01.

Windows 32-bit binaries 2.03.01

 

Decompress dos 32-bit binaries 2.03.01 to a folder, start the DOS virtual machine, use the shared folder method above, set the shared directory, and share the file as a drive letter, copy the DOS version of the Z drive (My shared folder is virtualized into the Z drive letter) to the hard disk of the VM.

In the C:/autoexec. BAT file, add the corresponding path to the PATH environment variable:

Use Edit to open C:/autoexec. BAT and add a set Path = C/ASM line at the end. (The copy directory of my assembly is C/ASM)

4. Generate a Minimum Operating System

Create a new folder C:/ASM under virtual DOS, enter the directory, and execute edit boot. ASM.

Enter the following code in the subsequent editing window:

 

% DEFINE _ boot_debug; debug in DOS

; Comment out this line when implementing a real system

That is, to make a. com file

% Ifdef _ boot_debug
Org 0100 h;
% Else
Org 7c00h; tells the compiler program to load at 7c00
% Endif

MoV ax, CS
MoV ds, ax
MoV es, ax

Call dispstr; call the display string routine

JMP $; infinite loop

Dispstr:

MoV ax, bootmessage
MoV bp, ax; es: BP = string address
MoV CX, str_len; Cx = String Length

MoV ax, 01301 h; Ah = 13, Al = 01 H
MoV BX, 000ch; page number: 0 (bH = 0) black background red letter (BL = 0ch, highlighted)
MoV dx, 0c20h

Int 10 h; 10 h interrupted
RET

Bootmessage: DB "Hello, OS world! "

Str_len equ $-bootmessage
Times 510-($-$) db 0; fill in the remaining space to make the generated binary code exactly 512 bytes
DW 0xaa55; End mark

Save as boot. ASM file

Use the command line NASM boot. ASM-O boot.com to compile and generate the boot.com program that can be executed under DOS;

Run boot.com directly to generate the following results:

The program is in the dead state after execution

 

We implement a real operating system and need to run it on bare metal. Therefore, comment out the first sentence of the Code .; % DEFINE _ boot_debug,

Use the command line NASM boot. ASM-O boot. bin to compile and generate boot. binfile; Use floppywriter tool to write to the disk image file (you can directly copy the disk image file used when installing the MS-DOS, or use winimage software to create a new MB disk image ); attach the corresponding floppy disk image file and start the virtual machine to see the effect.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.