Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running an OS on VirtualBox

I am using VirtualBox 4.1.14 on Windows 7 and I am trying to make it run my test OS. I am using the assembly code below and I am compiling it with

nasm -f bin -o boot.bin boot.asm

I am trying to convert the resulting bin file into an ISO that VB4.1.14 can use (I don't want to have to pay money or have any limits from a trial program). I have tried downloading different converters like bin2iso but VB comes up with different errors whenever I try to open the resulting ISO inside it like VERR_NOT_SUPPORTED and others.

I would prefer the solution to be a command line tool so I can use it in a batch script to make testing faster.

BITS 16

start:
    mov ax, 07C0h       ; Set up 4K stack space after this bootloader
    add ax, 288     ; (4096 + 512) / 16 bytes per paragraph
    mov ss, ax
    mov sp, 4096

    mov ax, 07C0h       ; Set data segment to where we're loaded
    mov ds, ax


    mov si, text_string ; Put string position into SI
    call print_string   ; Call our string-printing routine

    jmp $           ; Jump here - infinite loop!


    text_string db 'This is my cool new OS!', 0


print_string:           ; Routine: output string in SI to screen
    mov ah, 0Eh     ; int 10h 'print char' function

.repeat:
    lodsb           ; Get character from string
    cmp al, 0
    je .done        ; If char is zero, end of string
    int 10h         ; Otherwise, print it
    jmp .repeat

.done:
    ret


    times 510-($-$$) db 0   ; Pad remainder of boot sector with 0s
    dw 0xAA55       ; The standard PC boot signature
like image 569
hddh Avatar asked May 13 '12 12:05

hddh


People also ask

Does VirtualBox come with OS?

VirtualBox is designed to run virtual machines on your physical machine without reinstalling your OS that is running on a physical machine. One more VirtualBox advantage is that this product can be installed for free. A virtual machine (VM) works much like a physical one.

How many OS can VirtualBox install?

VirtualBox runs on four host operating systems: Windows (through Windows 7), Mac OS X, Linux and OpenSolaris. It can handle a lot more guest operating systems. VirtualBox itself installs as a standard application in its host operating system.

Where can Oracle VM VirtualBox run?

It can run everywhere from small embedded systems or desktop class machines all the way up to datacenter deployments and even Cloud environments. The following screenshot shows how Oracle VM VirtualBox, installed on an Apple Mac OS X computer, is running Windows Server 2016 in a virtual machine window. Figure 1.1.

What are the host and guest operating systems for VirtualBox?

VirtualBox supports a long list of host and guest operating systems. A host OS is the operating system installed on a physical machine, on which VirtualBox is installed. A guest OS is an operating system installed on a virtual machine running inside VirtualBox. VirtualBox can be installed on Windows, Linux, macOS, Solaris, and FreeBSD.

How to set up VirtualBox on Mac?

Go to the official web site to download the VirtualBox installer for your operating system (Windows in this case). If you are looking for how to set up VirtualBox on mac, download the OS X installer.

What is VirtualBox and how to use it?

Use VirtualBox for running software developed for different operating systems on your single physical machine simultaneously without the need to install multiple operating systems on a physical machine, and reboot to change the OS.


1 Answers

You can use dd (search dd for windows) to create a floppy for starters. The binary is just written to the first 256 bytes of a 1440 kib file.

dd if=/dev/zero of=floppy.img ibs=1k count=1440
dd if=boot.img of=floppy.img conv=notrunc

And here we go:

like image 61
copy Avatar answered Oct 07 '22 14:10

copy