Page 1 of 2

OSDev in Mac

Posted: Sat Jul 14, 2007 10:18 am
by no_one
Hi, I have an iMac and would like to get started in OS development. I have some experience in Cocoa and Flash programming. I know I'm not capable of it but I would like to get started. I know I need to know assembly but what syntax? If it's intel, should I use the NASM assembler? I also think I need a good understanding of how the computer works on the inside. Any good tutorials about this? Will I learn this stuff in the wiki? Will I need to know basic electronics? Please don't direct me to a book unless it's free because I have no credit card and I don't live in the US.

Posted: Sat Jul 14, 2007 10:26 am
by Alboin
Is it an intel mac or powerpc? That will mean a lot, if I'm not mistaken. (There's a great possibility of that. Never really used mac's much.)
no_one wrote:Please don't direct me to a book unless it's free because I have no credit card and I don't live in the US.
International Money Orders have always worked for me when buying things out of my country. (Gotta love Japanese video games. ;) )

Posted: Sat Jul 14, 2007 10:43 am
by no_one
It's an Intel Mac. When I said that I didn't have a credit card I meant I'm 15 years old and have no possible way of buying something from the US online if it's not with my dad's credit card which is not probable. =)

Posted: Sat Jul 14, 2007 11:17 am
by Brynet-Inc
Well, I only know a little about Intel Macs..

They use EFI instead of the classic PC BIOS, (Unless using something called "BootCamp?")
They use Core 2 Duo processors...

So, If you know x86 assembly and how to write an EFI capable bootloader.. learn what type of hardware these systems have and go from there..

(Google is your friend..)
http://refit.sourceforge.net/
http://refit.sourceforge.net/myths/

Posted: Sat Jul 14, 2007 11:29 am
by no_one
Ok, thanks. I don't understand anything you said but I'll google it. Just 2 things:

1. Is Q a good emulator (or is it even an emulator) for testing an OS in Mac?
2. Will I need to use NASM?

Thanks for your help.

Posted: Sat Jul 14, 2007 11:56 am
by Brynet-Inc
no_one wrote:I don't understand anything you said but I'll google it.
What is it you don't understand? EFI?
http://en.wikipedia.org/wiki/Extensible ... _Interface
no_one wrote:1. Is Q a good emulator (or is it even an emulator) for testing an OS in Mac?
It's simply the Mac OSX port of "QEMU", Which is an x86 emulator.. I don't think it supports EFI as of yet though..
no_one wrote:2. Will I need to use NASM?.
You keep asking this... but it totally depends on what you like using, Mac OSX includes the GNU toolchain IIRC, So you should have access to the GNU Assembler.. If you want to use NASM, go ahead... YASM has in my opinion a better licence.

Posted: Sat Jul 14, 2007 12:41 pm
by Alboin
Brynet-Inc wrote:So, If you know x86 assembly and how to write an EFI capable bootloader.. learn what type of hardware these systems have and go from there..
Or, use, GRUB! La la la!

You might need to create a cross compiler as well.

Posted: Sat Jul 14, 2007 12:48 pm
by no_one
I was said that the GNU assembler was a little cryptic and that I should use NASM. Ok thanks for your help, I'll check those out.

Posted: Sat Jul 14, 2007 10:22 pm
by Colonel Kernel
I also have an Intel iMac that I'm developing my OS on. However, I'm not targeting the Mac hardware (mainly because I don't want to learn about EFI just yet).

I use Parallels to test my OS, but that costs $$ so you might be out of luck there.

I use NASM because I never bothered to learn gas syntax.

Posted: Sat Jul 14, 2007 10:31 pm
by Brynet-Inc
gas has had support for intel syntax for years now... I wonder why people keep forgetting this.

Posted: Sat Jul 14, 2007 11:12 pm
by Colonel Kernel
I forgot it because I never use it. :) Probably no one pointed that out to me three years ago when I chose the assembler to use in my OS project, and I've never bothered to re-examine that decision since. :D

Posted: Sat Jul 14, 2007 11:28 pm
by pcmattman
Brynet-Inc wrote:gas has had support for intel syntax for years now... I wonder why people keep forgetting this.
I used to use NASM. Now I've switched to GAS (with the AT&T syntax) and I have tried to use the intel syntax several times. I've failed, unfortunately.

Either way, there's something about the GAS syntax that I really like. I just don't know what it is :lol:

Posted: Sun Jul 15, 2007 7:53 am
by Brynet-Inc
I like AT&T syntax as well.. prefer it actually.. makes more sense..

But I just "love" reminding people that it "does" support the "other" syntax if desired.

Posted: Sun Jul 15, 2007 8:06 am
by earlz
that "other" syntax though isn't completely implemented is it? When I try to inline something like mov byte [_myvar],0x20 it would give a trivial error(I forgot the exact error, but I remember it being why I couldn't use inline for lgdt)

NASM

Posted: Sun Jul 15, 2007 12:56 pm
by Mark139
The Mac dev tools (X-code) include NASM.

I've recently upgraded to a Mac from a PC and have started to move my OS dev project over.

So far I have built a cross compiler, which seems to work.

For emulation Q, Bochs and now VMWare are available, though I haven't yet got that far.

Good luck