Page 2 of 4
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 5:37 pm
by Troy Martin
Yeah but using AT&T with as makes everything standard and the same.
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 5:46 pm
by Love4Boobies
And using the Intel syntax for everything makes it the same plus more convenient for you
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 5:50 pm
by GeniusCobyWalker
Well, they are pretty much the same. I recommend GCC, NASM (well, that's me), Bochs.
I got (Code::Blocks) GCC, NASM, Bochs.
What now?
Also im using Ubuntu i386 AMD64 does that matter?
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 5:58 pm
by Love4Boobies
GeniusCobyWalker wrote:What now?
Now the fun begins. Start reading the
Intel manuals before anything else. After that, look around the wiki and you'll know what to do. It's normal to be confused at the begining
. If you still have problems, come back here and ask for more directions.
Anyway, you've got a pretty strange background... Zilog assembly and stuff like Blender?
I mean I played around with Blender myself but that's it... You will find that OSDeving is a lot different than application programming, espeically that of OpenGL & such. Nonetheless, I wish you good luck
Also im using Ubuntu i386 AMD64 does that matter?
Ubuntu i386 AMD64? I doubt there's such a platform
Do you mean your CPU is an AMD64?
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 6:19 pm
by GeniusCobyWalker
No it is Ubuntu 64 Bit.
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 6:21 pm
by Love4Boobies
Ok, but it can't be both i386 and AMD64. i386 stands for "Intel 80386" (although the AMD64 architecture is backwards-compatible with the i386). Anyway, it's fine what you have
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 7:23 pm
by GeniusCobyWalker
Does anybody know how to start a project for this in Code::Blocks?
How do I go about compiling it?
If anyone thinks I shouldn't use code::blocks what should I use?
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 7:27 pm
by Love4Boobies
You probably shouldn't be using an IDE to begin with. IDEs tend to control your applications for you and you don't want that for OSes; use command lines and makefiles. If you like nifty user interfaces, get an editor, otherwise use a simple UTF-8 text editor. You will find a list of editors on the wiki, as well as IDEs, but I would not recommend any of those unless you know what you're doing (and even so it's kind of pointless)...
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 8:12 pm
by Zenith
Personally, I'd disagree with that. Though I don't get Eclipse (the IDE of choice for me) to manage every facet of my OS project for me, I find it's helped simplify development a lot. I DO use a makefile (with autoconf), but Eclipse has a view for managing and executing makefile targets that's much easier to manage than continuously opening a bash shell. File/project management, class/object views, dependencies, and content-assist across multiple files, and compiler integration are just some of the useful advantages an IDE can offer that a text editor with command shell cannot, even in the case of OS development. But to each their own...
Re: [?]Help Starting OS [?]
Posted: Tue Jan 13, 2009 8:56 pm
by JohnnyTheDon
IDEs will work, but so will basic makefiles. Here is a simple one to get you started:
Code: Select all
CC = gcc
CFLAGS = -m32 -ffreestanding -nostdlib -nodefaultlibs -mcmodel=large -DBUILDING_KERNEL
ASM = nasm
ASMFLAGS =
LD = ld
LDFLAGS = -T linkerscript.ld --strip-all -nostdlib -nodefaultlibs
BIN = (Insert directory where you put compiled executables)
OUTPUT = (Insert name of output)
CSOURCES = $(wildcard *.c)
CHEADERS = $(wildcard *.h)
ASMSOURCES = $(wildcard *.s)
COBJECTS = $(patsubst %.c,%.o, $(CSOURCES))
ASMOBJECTS = $(patsubst %,%.o, $(ASMSOURCES))
.PHONY : all clean
all: $(BIN)$(OUTPUT)
clean:
rm -f *.o
$(BIN)$(OUTPUT): $(COBJECTS) $(ASMOBJECTS)
$(LD) $(LDFLAGS) -o $(BIN)$(OUTPUT) $(COBJECTS) $(ASMOBJECTS)
$(COBJECTS) : $(CSOURCES) $(CHEADERS)
$(CC) -c $(CFLAGS) -o $@ $(patsubst %.o,%.c, $@)
$(ASMOBJECTS) : $(ASMSOURCES)
$(ASM) -f elf32 $(ASMFLAGS) -o $@ $(patsubst %.o,%, $@)
$(CSOURCES) :
$(ASMSOURCES) :
$(CHEADERS) :
That will build a 32-bit ELF with all the .c and .s files in the directory. Make sure you also provide a linker script. Take a look at the bare bones tutorial for more info.
IDEs will work, but I prefer makefiles because I can easily create a script that will run my makefile, report any errors, copy my kernel to my disk image, and then run my emulator. Probably possible in an IDE as well, but idk how to set it up.
Re: [?]Help Starting OS [?]
Posted: Wed Jan 14, 2009 1:47 pm
by Combuster
I'd have serious trouble with people who
- can't compile code
- can't figure how to create a project
- can't distinguish i386 and amd64
- uses colours and therefore haven't read the forum rules.
So either this is cotton returning or you should really consider starting with something easier than an OS.
Re: [?]Help Starting OS [?]
Posted: Wed Jan 14, 2009 2:07 pm
by GeniusCobyWalker
Still need help.
How do I make these files in Ubuntu
Re: [?]Help Starting OS [?]
Posted: Wed Jan 14, 2009 2:14 pm
by Combuster
Re: [?]Help Starting OS [?]
Posted: Wed Jan 14, 2009 3:32 pm
by GeniusCobyWalker
Thanks for the links Combuster sorry that I haven't read them before.
Also fixed the signature (NO COLOURS).
How do I make these files?
(Unfamiliar with Ubuntu's file system)
I will use GEdit instead of Code::Blocks now
I will continue reading "Bare Bones" while waiting for a response.
Re: [?]Help Starting OS [?]
Posted: Wed Jan 14, 2009 3:35 pm
by JohnnyTheDon
How do I make these files?
You mean how do you run a makefile? Look at the docs for make (
http://www.gnu.org/software/make/manual/make.html ).
Basically, you just run make in the directory where your makefile is located. Here is a shell script that will let you do that without opening a terminal: