<deleted>
-
- 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:
Re: Bare bones doesn't actually work...
Sounds like you're just outputting a flat binary - I'd bet that the first 1 MB of that file is nothing but null bytes...My binary comes out at 1MB!
What you need to do is target a format like ELF. What is your toolchain?
-
- 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:
Re: Bare bones doesn't actually work...
Firstly, you shouldn't need sudo... Secondly, targeting 64-bit won't work with the barebones, as GRUB doesn't load a 64-bit kernel.Code: Select all
sudo yasm -m amd64 -f elf -o loader.o loader.s sudo gcc -B x86_64-elf -v 4.3.3 -o kernel.o -c kernel.c -Wall -Wextra -nostdlib -nostartfiles -nodefaultlibs # -Werror ld -T linker.ld -o kernel.bin loader.o kernel.o
Your commands should be something more like...
Code: Select all
yasm -f elf -o loader.o loader.s
i586-elf-gcc -o kernel.o -c kernel.c -Wall -Wextra -nostdlib -nostartfiles -nodefaultlibs # -Werror
i586-elf-ld -T linker.ld -o kernel.bin loader.o kernel.o
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: Bare bones doesn't actually work...
I generally shoot people at my front door, because sometimes they might be bears.Mr.McNugget (aka CJKay) wrote:Also, I use sudo generally in case it suddenly needs it. Qemu, for example, only loads the acceleration layer with sudo.
-
- 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:
Re: Bare bones doesn't actually work...
I think writing Linux viruses could become quite profitable in the futureGenerally, using sudo doesn't kill anything except a couple of calories (typing in the password) .
You're probably better off writing your own bootloader and second-stage to load your 64-bit kernel (with whatever paging you require) and jump to it.But about 64-bit?
-
- 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:
Re: Bare bones doesn't actually work...
The bootloader loads a binary from a filesystem (or specific disk layout), and then runs it. So there shouldn't be a need for "extern" in the bootloader.I just wrote a bootloader but restarted because I couldn't figure out how to link the C kernel to the assembly (binary doesn't support extern and what-not).
Have a look on Google for "64-bit OS GRUB" and see what comes up .Is there any possible way to make a 64-bit OS with GRUB?
I highly suggest you use the search feature of the forum, this is a topic that's come up several times before.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: GRUB error 13...
GRUB error 13...
Well, now I get error 13 >~>.
I get the blasted error 13 .
Is there something we don't knowit gives error 13 .
All the tutorials on this site use the fact that you can, and there are even guides on bootloaders.I couldn't figure out how to link the C kernel to the assembly
Newbie mistake #1: Always demand a tutorial for doing X, with respect to Y and Z notwithstanding A, but not B, demonstrating µ via ß including the kitchen sink. Bottom line: Do you have what it takes to write an OS.You have to search around a lot for a tutorial that fits exactly what you want.
In specific, you are expected to do your research, your expermentation, and your own piecing toghether of steps to achieve a goal. Right now you are annoying us in the hopes that we do your homework for you (of which you can be sure we don't)
Homework: this week's required reading consists of at least A B C, and three more relevant items of your choice.
Re: GRUB error 13...
Multiboot headers have nothing to do with a header file called multiboot.h!
Google "Multiboot Header" and read the first couple of pages that google finds. They may be helpful to you.
If that doesn't help you then you should try real hard to figure out what the distinction is between an ELF object file and an executable.
I know that this sort of thing can be pretty frustrating at first, but trust me, it just gets worse. Please try to read documentation and figure out as many problems as you can on your own or you will never get anywhere.
Google "Multiboot Header" and read the first couple of pages that google finds. They may be helpful to you.
If that doesn't help you then you should try real hard to figure out what the distinction is between an ELF object file and an executable.
I know that this sort of thing can be pretty frustrating at first, but trust me, it just gets worse. Please try to read documentation and figure out as many problems as you can on your own or you will never get anywhere.