Not Booting Correctly.. If at all..
Not Booting Correctly.. If at all..
Alright, I am using a boot loader and a kernel, of course, but before the kernel loads (or maybe it's the kernel) the system resets, the boot sector i am using anabled a20, does the stuff to enter protected mode, i have a 32 bit kernel, but i think my boot loader is the problem because i tried a pre-compiled kernel (fritzos) and it still rebooted, how can i find out where the problem is (oh, and when i compile FritzOS (prekernel 0.5) it doesnt work (it compiled but doesnt boot) but when i use the precompiled version it works just fine)
Re:Not Booting Correctly.. If at all..
I never got FritzOS to work for the same reason. What I do to find a problem since i dont have any IO yet, is place infinate loops in strategic locations to find out which instruction is not working. if it dosn't reset, the instructions before the loop aren't causeing the reset.
Re:Not Booting Correctly.. If at all..
ok, i have switched to bootf02 bootstrap and one of the example kernels it came with and it still does not work, (i DID compile it myself, again.. i dont see what's up with it...) thanks for the tip..
Re:Not Booting Correctly.. If at all..
at which instruction is it resetting? That would narrow down the possabilities of what could be wrong.
Re:Not Booting Correctly.. If at all..
alright, i haven't tried it, but i noticed: if i us the precompiled versions of BOotf02 (bootstrap and kernel) it works perfectly, if i replace any of the bootstrap or kernel with my compiled versions it doesnt work. it might be because i am not using jloc like it told me to, but what can i do? i am using linux, i cannot use jloc (maybe thats why in the clean version i see alot of 007c's and in mine i see 0000's (hexeditor)... ???
Re:Not Booting Correctly.. If at all..
Well, in that case it has to be your build utilities. What do you use? jloc? ehat compiler? Try using gcc and ld. Then code your own btldr. That way you should know what is hjappening since it it ur code U can't learn by stealing other peeps code
---
remember what tom said, debug the code:
startby just making sure the btldr works ie-stick a 'hlt' right after in jumps in. Then move on from there until it crashes. It is all a process of elimination
Regards,
Mr. xsism
---
remember what tom said, debug the code:
startby just making sure the btldr works ie-stick a 'hlt' right after in jumps in. Then move on from there until it crashes. It is all a process of elimination
Regards,
Mr. xsism
Re:Not Booting Correctly.. If at all..
I use gcc and ld (along with nasm).. and i didnt steal the code.
gcc 2.95.4 20011002 (Debian prerelease)
ld 2.12.90.0.1 20020307 Debian/GNU Linux
nasm 0.98.08 (soon upgrading to 0.98.34-1)
gcc 2.95.4 20011002 (Debian prerelease)
ld 2.12.90.0.1 20020307 Debian/GNU Linux
nasm 0.98.08 (soon upgrading to 0.98.34-1)
Re:Not Booting Correctly.. If at all..
I know a bit abuot Bootf02
You need to compile the bootloader to an object file and then link it to start at 0x7C00.
You then must compile the kernel and link it to 0x100000.
Therx
PS Beware if you experience problems with accessing memory later and are still using the Bootf02 boot sector it will be because Bootf02 enables paging. If you want to redo this your self you just need to remove a couple of the lines of code (I made this error :-[)
You need to compile the bootloader to an object file and then link it to start at 0x7C00.
You then must compile the kernel and link it to 0x100000.
Therx
PS Beware if you experience problems with accessing memory later and are still using the Bootf02 boot sector it will be because Bootf02 enables paging. If you want to redo this your self you just need to remove a couple of the lines of code (I made this error :-[)
Re:Not Booting Correctly.. If at all..
ha! my boot sector isn't working now and i havn't touched it! I'v only been working on my kernel! grrrrr. its the jump to set CS right after the switch to Pmode thats reseting it. so fustrating!
Re:Not Booting Correctly.. If at all..
Ok, it's just the bootsector that has a problem, and i cannot get NASM to make an object file (i get it to make a .o OR a .obj and ld doesnt understand it...) well.. it understands the .o but it creates a file MUCH larger than 512 bytes.. i am MOSTLY sure that i am using --oformat binary, if not then that may be my problem with the large file...
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Not Booting Correctly.. If at all..
iirc, the argument for nasm is -fbinary.
Your .o is too big because it has symbol table, relocations, etc.
Your .o is too big because it has symbol table, relocations, etc.
Re:Not Booting Correctly.. If at all..
Ok, it works fine now.. i did
nasm -f aout -o obj/boot.o boot.asm
ld --oformat binary -Ttext 0x7c00 -o boot.bin obj/boot.o
and it worked (except some bytes were switched, i corrected them with a hexeditor and it works great..) thanks for the help guys
nasm -f aout -o obj/boot.o boot.asm
ld --oformat binary -Ttext 0x7c00 -o boot.bin obj/boot.o
and it worked (except some bytes were switched, i corrected them with a hexeditor and it works great..) thanks for the help guys
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Not Booting Correctly.. If at all..
err ... i'm afraid you'll find it hard to boot with this ... LD is a 32 bits linker and boot code is 16bits... expect to encounter weird situations ...
Re:Not Booting Correctly.. If at all..
Well, it's worked fine as of yet, boots the kernel just fine, everything, does it matter that i have the use16 or [bits 16] in there, does that do anything at all?
Re:Not Booting Correctly.. If at all..
if it works, go for it! but as you edit it, and improve your OS and boot sector, you very well may run into problems.