From: Frank K. <fbk...@zy...> - 2009-07-10 13:33:36
|
zak100 wrote: > Hi, > I am able to make the binary using alink. partcopy was giving prob but it > was handled as done previously. > > The steps are provided below: > D:\nasm prog>nasm -f bin -o boot.bin BLKernelT.asm > > D:\NASMPR~1>nasm -f bin -o writeit.com writeit.asm > > D:\NASMPR~1>writeit > > D:\NASMPR~1>del test_kernel2.onj > Could Not Find D:\NASMPR~1\test_kernel2.onj > > D:\NASMPR~1>del test_kernel2.obj > > D:\NASMPR~1>nasm -f obj test_kernel2.asm > > D:\NASMPR~1>dir t*.obj > Volume in drive D is New Volume > Volume Serial Number is 70FD-1D2C > > Directory of D:\NASMPR~1 > > 07/10/2009 10:55 AM 642 test_kernel2.obj > 1 File(s) 642 bytes > 0 Dir(s) 22,656,360,448 bytes free > > D:\NASMPR~1>alink -o kernel.bin test_kernel2.obj main1.o > ALINK v1.6 (C) Copyright 1998-9 Anthony A.J. Williams. > All Rights Reserved > > Loading file test_kernel2.obj > Loading file main1.o > matched Externs > matched ComDefs > Warning, no entry point specified You can fix this by adding a "..start:" label where you want your entrypoint. > Warning - no stack segment stack stack resb ???? ; how big do you want? C uses a lot of stack, I understand. The first "stack" is just a name - could be anything. The second "stack" is necessary to let Nasm know what we want. I've been ignoring the warning, and "let the OS take care of the stack". We set up a stack in the bootsector which should be "okay for now". When you get to task switching/multitasking, you'll want to swap stacks for each process (I imagine). > D:\NASMPR~1>alink -o kernel.exe test_kernel2.obj main1.o > ALINK v1.6 (C) Copyright 1998-9 Anthony A.J. Williams. > All Rights Reserved > > Loading file test_kernel2.obj > Loading file main1.o > matched Externs > matched ComDefs > Warning, no entry point specified > Warning - no stack > > D:\NASMPR~1>del kernel.bin > > D:\NASMPR~1>exe2bin kernel.exe kernel.bin Good. This produces a .com file (no matter what we call it) which expects to be loaded at 100h into... whatever segment. > D:\NASMPR~1>partcopy kernel.bin 0 200 -f0 200 > Failed to read source at offset 144 > D:\NASMPR~1>partcopy kernel.bin 0 144 -f0 200 > > D:\NASMPR~1> > ----------------------------------- > > But when I rebooted , I got boot sector statment but I am not seeing the > "welcome....." kernel message. > Can somebody plz guide me?? Try jumping to 7D0h:100h (assuming that you're writing this to 7E00h). I haven't done anything further with this. I've downloaded source (in assembly) for an exe2bin clone, thinking we might be able to modify it to produce a binary at "org 0", or perhaps create a loader for MZ to be included in our code. Only just begun to look at it. Tyler mentioned using bochs for testing. That would speed up development a *lot* (especially for me, since I don't like rebooting). I've downloaded bochs a couple of times, but never tried it. I've seen too many posts about "my bootsector works in bochs, but not in a real machine" (or vise versa), and "bochs is giving me this error message, what the heck does it mean?"... suggesting that bochs doesn't accurately reflect "real hardware" (can't match *all* of 'em, of course), and has a "learning curve" to it... Any tips, Tyler? Is bochs going to insist on seeing a full 1.44M image before it'll boot from a "fake floppy"? Well, I'll figure it out (or not), if and when I get around to trying it... Best, Frank |