Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASM virtual-machine
Hi,
I am using Ubuntu as a virtual machine in VMWare.
I have used this code to write a boot loader which would write Hello world on the screen.
 
[BITS 16]
[ORG 0x7C00]
 
MOV SI, HelloString
CALL PrintString
JMP $
 

PrintCharacter:
 
MOV AH, 0x0E
MOV BH, 0x00
MOV BL, 0x07
 
INT 0x10
RET
 
PrintString:
 
next_character:
MOV AL, [SI]
INC SI
OR AL, AL
JZ exit_function
CALL PrintCharacter
JMP next_character
exit_function:
RET
 
HelloString db 'Hello World', 0
 
TIMES 510 - ($ - $$) db 0
DW 0xAA55
 
I wrote this code in the text editor in Ubuntu and saved the file as Boot.asm
Then i complied the Boot.asm to boot.bin file by using this command
 
nasm -f bin -o boot.bin Boot.asm
 
and it didn't gave me any errors. After that i copied the boot.bin file to my usb and took it to my Windows OS. After this i burned the boot.bin file to boot.img and boot.iso files.
Then i created a new virtual machhine and named it booter, when it asked for the .iso file of the OS i want to run i gave it the boot.iso file, about which i told above, then i powered on that virtual machine but it gave me this error
 
PXE-M0F: No boot filename received
PXE-M0F: Exiting Intel PXE ROM
Operating System not found
 
Please tell me what is the main problem and how can i over come that problem
Posted 6-Dec-12 4:47am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The assembler does not produce executable code, let alone bootable. The .bin file will need to be linked into an executable and then possibly post-processed into a bootable image. You also need to understand that you cannot make system calls (such as int 0x10) in a bootloader as there is no operating system to service them.
 
You need to get hold of some documentation about creating a boot loader and bootable images. There is a series of articles here on CodeProject which explains some of the techniques to do this.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100