OSDev in Mac

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
no_one
Posts: 17
Joined: Sat Jul 14, 2007 9:47 am

OSDev in Mac

Post 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.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post 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. ;) )
C8H10N4O2 | #446691 | Trust the nodes.
no_one
Posts: 17
Joined: Sat Jul 14, 2007 9:47 am

Post 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. =)
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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/
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
no_one
Posts: 17
Joined: Sat Jul 14, 2007 9:47 am

Post 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.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post 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.
C8H10N4O2 | #446691 | Trust the nodes.
no_one
Posts: 17
Joined: Sat Jul 14, 2007 9:47 am

Post 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.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post 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.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

gas has had support for intel syntax for years now... I wonder why people keep forgetting this.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post 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
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post 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:
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post 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)
Mark139
Member
Member
Posts: 39
Joined: Mon Jan 15, 2007 2:32 pm

NASM

Post 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
Post Reply