Developing under OS-X
Developing under OS-X
Well, what works is assembling to binary with nasm, but I obviously don't have a floppy drive, so I would like to test under a virtual machine (Virtualbox). Now I tried making a disk image, but I'm stuck. How do you create a disk image from raw data that works under Virtualbox?
Re: Developing under OS-X
You have to create an image file in format it understand.
http://www.virtualbox.org/manual/ch05.html#vdidetails
There is probably some tools to convert from raw image to the listed format too. Try google it.
As a side note, I'm not familiar with virtualbox but qemu support plain file as disk image, ie. each 512 byte is exactly the same sector position in the disk view from guest machine. it support i386 and x86_64 and is easily install with macport / sudo port install qemu.
http://www.virtualbox.org/manual/ch05.html#vdidetails
There is probably some tools to convert from raw image to the listed format too. Try google it.
As a side note, I'm not familiar with virtualbox but qemu support plain file as disk image, ie. each 512 byte is exactly the same sector position in the disk view from guest machine. it support i386 and x86_64 and is easily install with macport / sudo port install qemu.
Re: Developing under OS-X
Alright, then I'll just try Qemu. Thanks!
Re: Developing under OS-X
VirtualBox has it's own tool for this.bluemoon wrote:There is probably some tools to convert from raw image to the listed format too. Try google it.
Create a DMG/IMG using hdiutil or even just dd then use
Code: Select all
VBoxManage convertFromRaw --format VDI input.dmg output.vdi
Re: Developing under OS-X
I've found QEMU to be faster on the new i5 and i7 based Macs.berkus wrote:I would still recommend bochs.app over any other tool for osdev on osx.
Granted, I am emulating multiple cores (large slowdown) as well as a resolution of 1440 x 900 (some buffer copies can be intensive)
Otherwise I absolutely agree.
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: Developing under OS-X
I think that the key factor here isn't speed, but ease of debugging - and I highly doubt that any other emulator will ever (or at least soon) become superior to bochs in terms of debugging.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Re: Developing under OS-X
The best tool for programming OS stuff on a Mac (IMO) is Linux running in a VM. Then on the VM Linux run your OS under SimNow (for low-level debugging) or qemu (for C source level debugging). I've not tried Bochs, but SimNow is superb for assembler-level debugging.
It sounds a bit perverse running VMs within VMs, but I find it far easier than setting up the appropriate development environment on OS X.
It sounds a bit perverse running VMs within VMs, but I find it far easier than setting up the appropriate development environment on OS X.
Re: Developing under OS-X
WTF?!? What's wrong with it's native stuff? You have bash, vim, perl, binutils, gcc, llvm, gnu/make, nasm, fasm, dd... everything you'll ever need for OSDEV. You can create and mount FAT natively. Only thing to do is a cross-compiler (same as with Linux), that's all (or you can use objconv).iansjack wrote:The best tool for programming OS stuff on a Mac (IMO) is Linux running in a VM.
I think using linuxvm is a very very bad advice.
Re: Developing under OS-X
LoL, by definition this is not programming OS stuff on a Mac, but is programming on Linux.iansjack wrote:The best tool for programming OS stuff on a Mac (IMO) is Linux running in a VM.
Re: Developing under OS-X
I would add building gdb to the list as well. Mac's built-in gdb won't work with elf. But then, develop on mac is totally workable, as I'm just doing that.turdus wrote:You have bash, vim, perl, binutils, gcc, llvm, gnu/make, nasm, fasm, dd... everything you'll ever need for OSDEV. You can create and mount FAT natively. Only thing to do is a cross-compiler (same as with Linux), that's all (or you can use objconv).
Re: Developing under OS-X
+1 from me too. You also have Eclipse and Xcode. I use vmware fusion and connect a cross-gdb to the vmware kernel debugger to debug my OS. I also use VMware serial ports tailed to a terminal for kernel logging. The only time I need Windows or Linux is to occasionally check that my build scripts work on those OS's.bluemoon wrote:I would add building gdb to the list as well. Mac's built-in gdb won't work with elf. But then, develop on mac is totally workable, as I'm just doing that.turdus wrote:You have bash, vim, perl, binutils, gcc, llvm, gnu/make, nasm, fasm, dd... everything you'll ever need for OSDEV. You can create and mount FAT natively. Only thing to do is a cross-compiler (same as with Linux), that's all (or you can use objconv).
[Edit] Okay, I also occasionally use Linux to reformat my virtual disks when my ext2 driver trashes them.
If a trainstation is where trains stop, what is a workstation ?
Re: Developing under OS-X
I always have a copy of clean disk image, so when I messed up the testing image, I'd just "cp initial.img testing.img".gerryg400 wrote:I also occasionally use Linux to reformat my virtual disks when my ext2 driver trashes them.
Re: Developing under OS-X
I think you confuse Macs and OS X; they are not the same thing. It is programming in Linux on a Mac (it sure as hell isn't a PC!).bluemoon wrote:LoL, by definition this is not programming OS stuff on a Mac, but is programming on Linux.iansjack wrote:The best tool for programming OS stuff on a Mac (IMO) is Linux running in a VM.
Re: Developing under OS-X
Well, I think it's useful to keep my cross-compiling environment jailed from my native environment. I can take snapshots of the environment, play about with it and revert easily if I don't like the results.turdus wrote:WTF?!? What's wrong with it's native stuff? You have bash, vim, perl, binutils, gcc, llvm, gnu/make, nasm, fasm, dd... everything you'll ever need for OSDEV. You can create and mount FAT natively. Only thing to do is a cross-compiler (same as with Linux), that's all (or you can use objconv).iansjack wrote:The best tool for programming OS stuff on a Mac (IMO) is Linux running in a VM.
I think using linuxvm is a very very bad advice.
It suits me. If it doesn't suit you, that's fine.
Re: Developing under OS-X
I always have a clean copy of my entire development environment. Same logic.bluemoon wrote:I always have a copy of clean disk image, so when I messed up the testing image, I'd just "cp initial.img testing.img".gerryg400 wrote:I also occasionally use Linux to reformat my virtual disks when my ext2 driver trashes them.