Read "write your own operating system" and try to build a Linux environment

Source: Internet
Author: User
After reading "write the operating system by yourself", try to build the Linux environment and read "write the operating system by yourself" and then try again. Because I don't want to use windows as the development platform, I have built a Linux card distribution platform. Tools required for www.2cto.com: nasm, qemu, dd first, create...
After reading "write the operating system by yourself", try to build the Linux environment and read "write the operating system by yourself" and then try again. Because I don't want to use windows as the development platform, I have built a Linux card distribution platform. Tools required for www.2cto.com: nasm, qemu, and dd: First, create a disk image file. Edit a boot. the asm file is as follows: the assembly code org 07c00h tells the compiler program to load mov ax, cs mov ds, ax mov es, ax call DispStr at 7c00; call the display string routine jmp $; infinite Loop DispStr: mov ax, BootMessage mov bp, ax; ES: BP = string address mov cx, 16; CX = string length mov ax, 01301 h; AH = 13, AL = 01 h mov bx, 000ch; page number is 0 (BH = 0) black bottom red letter (BL = 0Ch, highlighted) mov dl, 0 int 10 h; ret BootMessage: db "Hello, OS world! "Times 510-($-$) db 0; fill in the remaining space to make the generated binary code exactly 512 bytes dw 0xaa55; end Mark www.2cto.com 1. Compile with nasm: $ nasm boot. asm-o boot. bin to get a 512-byte boot. binfile. this is the code in the boot sector of the floppy disk. 2. you can use the following command to generate a disk image File: $ dd conv = sync if = boot. bin of = boot. img bs = 1440 k count = 1 so that we can get the disk image boot. img. Note that conv = sync in the command. With this option, each input block can be filled with ibs bytes, and the remaining part can be filled with NULL characters. In this example, the input file contains only 512 bytes, but the output file requires MB. Therefore, I used this option. 3. use qemu to start the image File: qemu-fda boot. img-boot a-m 64-localtime
Related Article

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.