0x100000
-
hazardoxide
- Member

- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
0x100000
apologies. This is my last question for now. first, thanks for all the help. good site.ok. i have a bootable floppy with grub installed that loads the kernel from 0x100000. how do i write my kernel to that address?
If bill gates had a dollar for everytime windows crashed...oh wait... he does.
GRUB loads the kernel to 0x100000 not from it. That is a location in memory - the 1mb mark to be exact. All you do is point GRUB to your kernel image and it does the rest.
The cake is a lie | rackbits.com
-
hazardoxide
- Member

- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
then you need to include GRUB in your image...
i have a very round-about way of making iso's, as im using a windows platform.
what i do:
+ Compile the source into kernel.bin
+ Use this + grub in VFD (virtual floppy driver) for testing
+ Save this as .img
+ Using MagicISO take the boot code from the .img, and add the boot folder for grub, along with kernel.bin to a new bootable .iso
+ Save and burn to disk using Nero
i have a very round-about way of making iso's, as im using a windows platform.
what i do:
+ Compile the source into kernel.bin
+ Use this + grub in VFD (virtual floppy driver) for testing
+ Save this as .img
+ Using MagicISO take the boot code from the .img, and add the boot folder for grub, along with kernel.bin to a new bootable .iso
+ Save and burn to disk using Nero
hazardoxide,
First, make sure you use the Fat12 GRUB version. Follow what lukem says to do, then put the following in your "menu.cfg" file, substituting where you need to:
First, make sure you use the Fat12 GRUB version. Follow what lukem says to do, then put the following in your "menu.cfg" file, substituting where you need to:
Code: Select all
title OS
root (fd0)
kernel /kernel.bin-
hazardoxide
- Member

- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
well, im not sure what to do with vfd. i downloaded it. installed and started the driver, set it to A:, now what? i got a floppy with grub installed, and in the menu.lst, i have it setup to look for: kernel (fd0)/boot/kernel.bin but when i out my bin there, it says it's an unreconized or unsupported format. and i also tried moving all the files from the real grub floppy with kernel.bin to virtual floppy A: in "my computer" and with an empty 1.44 img file created in it, but when i try to save from vfd, is says "device not ready" formatting too, it always says to me, device not ready.
If bill gates had a dollar for everytime windows crashed...oh wait... he does.
-
hazardoxide
- Member

- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
That depends on your build environment. An ELF cross compiler, like the one described in the wiki, will output an ELF file by default but will (probably) barf on the lack of a linker script. OS Specific toolchains (for user code) have an included linker script specific to that platform.hazardoxide wrote:what is the default output format of ld if i leave it alone
The cake is a lie | rackbits.com
- 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:
The cross-compiler on the wiki comes with a builtin linker script that does pretty much of the default things (if you want to link applications, it will probably be good enough). There is a commandline switch that makes ld dump its builtin linker script.ucosty wrote:That depends on your build environment. An ELF cross compiler, like the one described in the wiki, will output an ELF file by default but will (probably) barf on the lack of a linker script. OS Specific toolchains (for user code) have an included linker script specific to that platform.hazardoxide wrote:what is the default output format of ld if i leave it alone
-
hazardoxide
- Member

- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm
I'm trying to compile james M'S tut using djgpp and nasm. I made boot.asm (compiled ok) I compiled main.c (with warnings) but when i try to like them (using link.ld) i get the following errors:
using: ld -T C:\os\link.ld -o C:\os\kernel.bin C:\os\boot.o C:\os\main.o
when compiling main.c i get the following warnings:
Whats going on here?
thanks,
Code: Select all
C:\os\main.o:crt0.s:(.text+0x0): multiple definition of 'start'
C:\os\boot.o:C:\os\boot.o:(.text+0x20): first defined here
C:\os\boot.o:C:\os\boot.o:(.text+0x30): undefined reference to 'main'
when compiling main.c i get the following warnings:
Code: Select all
C:\os\main.c:1: warning: 'struct multiboot' declared inside parameter list
C:\os\main.c:1: warning: its scope is only this definition or declaration, which is probably not what you want
C:\os\main.c:4:2: warning: no newline at end of file
thanks,
If bill gates had a dollar for everytime windows crashed...oh wait... he does.
- 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:
Its your toolchain, you should know what it does.Whats going on here?
You're probably not using a GCC Cross-Compiler, no?
-
hazardoxide
- Member

- Posts: 26
- Joined: Thu Dec 13, 2007 12:31 pm


