You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(31) |
Nov
(9) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2005 |
Jan
(8) |
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
(4) |
Dec
(1) |
2006 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(4) |
Dec
|
2007 |
Jan
|
Feb
(4) |
Mar
(8) |
Apr
(7) |
May
(1) |
Jun
(6) |
Jul
(7) |
Aug
(26) |
Sep
(8) |
Oct
(14) |
Nov
(7) |
Dec
(4) |
2008 |
Jan
(5) |
Feb
(7) |
Mar
(31) |
Apr
(18) |
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(3) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
(9) |
Jun
(8) |
Jul
(17) |
Aug
(24) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(15) |
Nov
|
Dec
(5) |
2011 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
(6) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(4) |
Dec
(1) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Frank K. <fbk...@zy...> - 2009-07-15 09:52:33
|
zak100 wrote: > I have also created a stack but its not detected by the linker. Well, your loader doesn't pay any attention to where Alink would say the stack was, anyway. You may be better off to "let the OS take care of the stack" like we do in real OSen. You set up a stack in your bootsector - not very big but it should do for now. Easily made bigger. Since I haven't got exe2bin on Linux, I tried loading the MZ executable that Alink produces. This is very rudimentary - won't load a very complicated MZ file. I've been ignoring the warning about "no stack" - I'm afraid even adding a stack will complicate the MZ too much for this feeble effort, so no stack (I use yours), and no "data" segment declared - everything's in "segment code". "build" won't work for you, of course... Slow going. I'm tired. I don't even know if I can attach a file to this list. Try it. Later, Frank |
From: zak100 <zul...@ya...> - 2009-07-12 13:19:15
|
I have also created a stack but its not detected by the linker. D:\nasm prog>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 stack D:\nasm prog> CLI ;Clear Interupt Flag so while setting ;up the stack any interrupt would not be fired. mov AX,7B0h ;lets have the stack start at 7c00h-256 = 7B00h mov SS,ax ;SS:SP = 7B0h:256 = 7B00h:256 mov SP,256 ;Lets make the stack 256 bytes. ; Mov ax,CS ;Set the data segment = CS = 0 ; suggest you use 0 here! XOR AX,AX ;Makes AX=0. MOV ES,AX ;Make ES=0 mov DS,ax STI ;Set Back the Interupt Flag after ;we finished setting a stack frame. zak100 wrote: > > Hi, > > The changes for jump code lies here: > > GiveControlToOS: ; PROC > > LEA AX,[szDone] > Call PrintMessage > CALL GetKey > > ; db 0e9h ;Far JMP op code. > ; dw 512 ;JMP 512 bytes ahead > ;jmp 0:7E00h;-----------------------------------At this point we are > going to Kernel code; for including C prog:test_kernel2.asm > > ;jmp 7D0h:100h > jmp 0:7D00h > ; POP AX ;//Another why to make > ;the CPU jump to a new place. > ; POP AX > ; Push 7E0h ;Push New CS address. > ; Push 0 ;Push New IP address. > ;The address that comes out is 7E00:0000. > ; comment does not match code! > > > ;(512 bytes Higher from were BIOS Put us.) > retf > ; you'd want "retf" here. > > ;GiveControlToOS EndP > > The changes for ..start lie here > > ..start: > extern _K_main > ;--- test kernel.bin--- > > ; push cs > ; push cs > ; pop ds > ; pop es > mov ax, 7E0H > mov ds,ax > mov es,ax > mov si, msg > > mov ah, 0Eh > mov bx, 7 > top: > lodsb > cmp al, 0 > jz blackhole > int 10h > jmp short top > > blackhole: > > mov cx,1000 > Delay: Loop Delay > call _K_main; this is in main.c > hlt > jmp blackhole > > msg db 'Welcome to the Kernel!', 0 > > times 0x200-($-$$) db 0 > > Kindly help me with this. > > > Zulfi. > > Frank Kotler-3 wrote: >> >> 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 >> >> >> ------------------------------------------------------------------------------ >> Enter the BlackBerry Developer Challenge >> This is your chance to win up to $100,000 in prizes! For a limited time, >> vendors submitting new applications to BlackBerry App World(TM) will have >> the opportunity to enter the BlackBerry Developer Challenge. See full >> prize >> details at: http://p.sf.net/sfu/Challenge >> _______________________________________________ >> Nasm-users mailing list >> Nas...@li... >> https://lists.sourceforge.net/lists/listinfo/nasm-users >> >> > > -- View this message in context: http://www.nabble.com/calling-%27C%27-functions-tp24404865p24448606.html Sent from the nasm-users mailing list archive at Nabble.com. |
From: zak100 <zul...@ya...> - 2009-07-10 18:07:22
|
Hi, The changes for jump code lies here: GiveControlToOS: ; PROC LEA AX,[szDone] Call PrintMessage CALL GetKey ; db 0e9h ;Far JMP op code. ; dw 512 ;JMP 512 bytes ahead ;jmp 0:7E00h;-----------------------------------At this point we are going to Kernel code; for including C prog:test_kernel2.asm ;jmp 7D0h:100h jmp 0:7D00h ; POP AX ;//Another why to make ;the CPU jump to a new place. ; POP AX ; Push 7E0h ;Push New CS address. ; Push 0 ;Push New IP address. ;The address that comes out is 7E00:0000. ; comment does not match code! ;(512 bytes Higher from were BIOS Put us.) retf ; you'd want "retf" here. ;GiveControlToOS EndP The changes for ..start lie here ..start: extern _K_main ;--- test kernel.bin--- ; push cs ; push cs ; pop ds ; pop es mov ax, 7E0H mov ds,ax mov es,ax mov si, msg mov ah, 0Eh mov bx, 7 top: lodsb cmp al, 0 jz blackhole int 10h jmp short top blackhole: mov cx,1000 Delay: Loop Delay call _K_main; this is in main.c hlt jmp blackhole msg db 'Welcome to the Kernel!', 0 times 0x200-($-$$) db 0 Kindly help me with this. Zulfi. Frank Kotler-3 wrote: > > 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 > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full > prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Nasm-users mailing list > Nas...@li... > https://lists.sourceforge.net/lists/listinfo/nasm-users > > -- View this message in context: http://www.nabble.com/calling-%27C%27-functions-tp24404865p24432204.html Sent from the nasm-users mailing list archive at Nabble.com. |
From: zak100 <zul...@ya...> - 2009-07-10 18:05:17
|
Hi, The changes for jump code lies here: GiveControlToOS: ; PROC LEA AX,[szDone] Call PrintMessage CALL GetKey ; db 0e9h ;Far JMP op code. ; dw 512 ;JMP 512 bytes ahead ;jmp 0:7E00h;-----------------------------------At this point we are going to Kernel code; for including C prog:test_kernel2.asm ;jmp 7D0h:100h jmp 0:7D00h ; POP AX ;//Another why to make ;the CPU jump to a new place. ; POP AX ; Push 7E0h ;Push New CS address. ; Push 0 ;Push New IP address. ;The address that comes out is 7E00:0000. ; comment does not match code! ;(512 bytes Higher from were BIOS Put us.) retf ; you'd want "retf" here. ;GiveControlToOS EndP The changes for ..start lie here ..start: extern _K_main ;--- test kernel.bin--- ; push cs ; push cs ; pop ds ; pop es mov ax, 7E0H mov ds,ax mov es,ax mov si, msg mov ah, 0Eh mov bx, 7 top: lodsb cmp al, 0 jz blackhole int 10h jmp short top blackhole: mov cx,1000 Delay: Loop Delay call _K_main; this is in main.c hlt jmp blackhole msg db 'Welcome to the Kernel!', 0 times 0x200-($-$$) db 0 Kindly help me with this. Zulfi. Frank Kotler-3 wrote: > > 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 > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full > prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Nasm-users mailing list > Nas...@li... > https://lists.sourceforge.net/lists/listinfo/nasm-users > > -- View this message in context: http://www.nabble.com/calling-%27C%27-functions-tp24404865p24432173.html Sent from the nasm-users mailing list archive at Nabble.com. |
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 |
From: zak100 <zul...@ya...> - 2009-07-10 06:11:04
|
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 Warning - no stack 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 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?? Zulfi. zak100 wrote: > > Hi Peter and Frank, > I am able to compile the code after removing the brackets but now I am > getting prob with ld. > D:\nasm prog>nasm -f elf test_kernel2.asm -o test.o > > D:\NASMPR~1>ld -o kernel.exe test.o main1.o > test.o:(.text+0xa): relocation truncated to fit: R_386_16 against `.text' > > D:\NASMPR~1>dir k* > Volume in drive D is New Volume > Volume Serial Number is 70FD-1D2C > > Directory of D:\NASMPR~1 > > File Not Found > > D:\NASMPR~1> > > I downloaded alib but some files were missing. Thanks for your attention > but I am still looking for more help on this using ld. > > In the meantime, i would be looking for alib again. > > Zulfi. > > > Frank Kotler-3 wrote: >> >> H. Peter Anvin wrote: >>> zak100 wrote: >>>> Hi, >>>> I am trying to call 'C" functions from my tiny kernel code. Can >>>> somebody plz >>>> help me with this? >>>> ; call c function >>>> extern [_K_main] >>> >>> That should be >>> >>> extern _K_main >>> >>> No brackets... >> >> Now why haven't I seen my reply to Zulfi... in which I point out that >> "-f bin" isn't going to like it without the brackets, either? Maybe >> "nasm-users" doesn't like me... >> >> Anyway... I tried the following experiment... Since I don't "do" C >> (much), I made up a "fake" kmain, which simply prints the letter "K" on >> the screen and returns. Assembled with "-f obj". Added a "..start:" >> label to "test_kernel2", and assembled that with "-f obj". Since I've >> got Alink working under Linux, I tried to link 'em with "alink -oCOM >> test_kernel2.obj kmain.obj". Alink warns that it's discarding data at >> offset... well, all of 'em... and produces a zero-length .com file. >> That's not going to help. So tried "-oEXE". Got an .exe! Since I don't >> have an MZ loader at hand, nor "exe2bin" (which might work), I simply >> removed the header with a text editor. The offsets happened to work out >> - I doubt if this will always be true! I think we're going to need a >> proper MZ loader to handle relocations, eventually. But for now... >> >> I combined "boot.bin" with this result using "cat", and wrote the >> resulting "image.bin" to floppy. Wrote that to floppy with "dd". Booted, >> and after "Welcome to the kernel", saw 'K' printed... repeatedly. >> Progress! >> >> This isn't exactly what you want to do, but leads me to believe that, >> with the proper tools, it may not be as difficult as I imagined. (famous >> last words...) >> >> Best, >> Frank >> >> >> ------------------------------------------------------------------------------ >> Enter the BlackBerry Developer Challenge >> This is your chance to win up to $100,000 in prizes! For a limited time, >> vendors submitting new applications to BlackBerry App World(TM) will have >> the opportunity to enter the BlackBerry Developer Challenge. See full >> prize >> details at: http://p.sf.net/sfu/Challenge >> _______________________________________________ >> Nasm-users mailing list >> Nas...@li... >> https://lists.sourceforge.net/lists/listinfo/nasm-users >> >> > > -- View this message in context: http://www.nabble.com/calling-%27C%27-functions-tp24404865p24422303.html Sent from the nasm-users mailing list archive at Nabble.com. |
From: zak100 <zul...@ya...> - 2009-07-10 05:07:14
|
Hi Peter and Frank, I am able to compile the code after removing the brackets but now I am getting prob with ld. D:\nasm prog>nasm -f elf test_kernel2.asm -o test.o D:\NASMPR~1>ld -o kernel.exe test.o main1.o test.o:(.text+0xa): relocation truncated to fit: R_386_16 against `.text' D:\NASMPR~1>dir k* Volume in drive D is New Volume Volume Serial Number is 70FD-1D2C Directory of D:\NASMPR~1 File Not Found D:\NASMPR~1> I downloaded alib but some files were missing. Thanks for your attention but I am still looking for more help on this using ld. In the meantime, i would be looking for alib again. Zulfi. Frank Kotler-3 wrote: > > H. Peter Anvin wrote: >> zak100 wrote: >>> Hi, >>> I am trying to call 'C" functions from my tiny kernel code. Can somebody >>> plz >>> help me with this? >>> ; call c function >>> extern [_K_main] >> >> That should be >> >> extern _K_main >> >> No brackets... > > Now why haven't I seen my reply to Zulfi... in which I point out that > "-f bin" isn't going to like it without the brackets, either? Maybe > "nasm-users" doesn't like me... > > Anyway... I tried the following experiment... Since I don't "do" C > (much), I made up a "fake" kmain, which simply prints the letter "K" on > the screen and returns. Assembled with "-f obj". Added a "..start:" > label to "test_kernel2", and assembled that with "-f obj". Since I've > got Alink working under Linux, I tried to link 'em with "alink -oCOM > test_kernel2.obj kmain.obj". Alink warns that it's discarding data at > offset... well, all of 'em... and produces a zero-length .com file. > That's not going to help. So tried "-oEXE". Got an .exe! Since I don't > have an MZ loader at hand, nor "exe2bin" (which might work), I simply > removed the header with a text editor. The offsets happened to work out > - I doubt if this will always be true! I think we're going to need a > proper MZ loader to handle relocations, eventually. But for now... > > I combined "boot.bin" with this result using "cat", and wrote the > resulting "image.bin" to floppy. Wrote that to floppy with "dd". Booted, > and after "Welcome to the kernel", saw 'K' printed... repeatedly. > Progress! > > This isn't exactly what you want to do, but leads me to believe that, > with the proper tools, it may not be as difficult as I imagined. (famous > last words...) > > Best, > Frank > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full > prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Nasm-users mailing list > Nas...@li... > https://lists.sourceforge.net/lists/listinfo/nasm-users > > -- View this message in context: http://www.nabble.com/calling-%27C%27-functions-tp24404865p24421875.html Sent from the nasm-users mailing list archive at Nabble.com. |
From: Frank K. <fbk...@zy...> - 2009-07-09 18:11:24
|
Tyler Littlefield wrote: > writing a kernel isn't to dificult; check out osdev.org if your in to that. > the issues start when you start to write a memory manager, etc etc. And then wrote: > ld will allow you to manage where your entry point is. > If your using grub, you can make your files elf which makes things a bit > easier for loading. > My current os dev environment uses linux and bochs for testing. I > compile the code, if successfull it generates my iso and I just cd ~ and > load up bochs for testing. > HTH somewhat, Hi Tyler, I don't mention it often enough: to reply to this list, you've gotta hit "reply all" - just "reply" sends only to the poster. Sorry that bit ya. I ASSume you wanted to reply to the list... if not, sorry again. :) I've been corresponding with Zulfi, and there have been messages on the "beginner's questions" forum (and elsewhere? nabble?), so to try to get everybody on the same page... What Zulfi has in mind is something like this: http://portal.acm.org/citation.cfm?id=1509022 ------------------------ ABSTRACT This paper describes a semester project where students design an operating system from the ground-up, capable of booting from a floppy disk on an actual machine. Unlike previous projects of this kind, this project was designed for students with only one semester of programming experience and no prior exposure to data structures, assembly language, or computer organization. Students nevertheless wrote a full system consisting of system calls, program execution, a file system, a command-line shell, and support for multiprocessing. The project was assigned to a class and successfully completed by nearly every student. ------------------------- Sounds wildly optimistic to me, but... The idea is to "hand" the students a bootsector, and another few routines in asm, and they write the C parts (after one year of Java, in Black's experiment!). I've been trying to help out with the asm parts (I guess that's going okay), but I'm clueless in C (only use for it is printing floats with printf... and that's not gonna work here! :) Zulfi's on a Windows platform, and I (and Black, and you, and most everybody "serious") run Linux. This doesn't help with the "tools" issue (although a lot of it has been ported). I don't know if this is "negotiable". This is going to be a 16-bit OS (be thankful for small favors). I suspect your suggestion to check out osdev.org and/or alt.os.development is probably the next stop. Best, Frank |
From: Frank K. <fbk...@zy...> - 2009-07-09 15:54:57
|
zak100 wrote: > Hi, > I am trying to call 'C" functions from my tiny kernel code. Can somebody plz > help me with this? > ; call c function > extern [_K_main] > ;--- test kernel.bin--- > > ; push cs > ; push cs > ; pop ds > ; pop es > mov ax, 7E0H > mov ds,ax > mov es,ax > mov si, msg > > mov ah, 0Eh > mov bx, 7 > top: > lodsb > cmp al, 0 > jz blackhole > int 10h > jmp short top > > blackhole: > > mov cx,1000 > Delay: Loop Delay > call _K_main; this is in main.c > hlt > jmp blackhole > > msg db 'Welcome to the Kernel!', 0 > > times 0x200-($-$$) db 0 > > > I am getting following error mesg: > D:\nasm prog>nasm -f bin -o boot.bin test_kernel2.asm > test_kernel2.asm:5: error: label or instruction expected at start of line Hi Zulfi, Removing the brackets will at least give you correct syntax (extern _K_main), but binary format still doesn't know about external references. What format is your proposed _K_main in? OMF probably, for 16-bit code(???). Try assembling with "nasm -f obj test_kernel2.asm" this will produce "test_kernel2.obj", by default. If your linker won't handle long file names, you can shorten it with the "-o" switch, but your linker is probably going to be happier with ".obj" than ".bin" (maybe not?). Then... your linker is probably going to want to produce an MZ executable by default. I don't think it's too hard to write a loader for MZ, but it might be easier to persuade your linker to produce a .com file. I believe ld (for 32-bit Linux - won't help you) can be coerced to produce a flat binary, explicitly specifying origins for the various sections (if you know how - I don't). If your linker will do that, you're in luck. Failing that... I dunno. Make sure your compiler isn't producing any "dosisms" in your C code, of course. The OS-development guys may have better advice on this. Best, Frank P.S. Thanks for asking here, rather than nasm-devel, Zulfi! :) |
From: Frank K. <fbk...@zy...> - 2009-07-09 15:52:33
|
H. Peter Anvin wrote: > zak100 wrote: >> Hi, >> I am trying to call 'C" functions from my tiny kernel code. Can somebody plz >> help me with this? >> ; call c function >> extern [_K_main] > > That should be > > extern _K_main > > No brackets... Now why haven't I seen my reply to Zulfi... in which I point out that "-f bin" isn't going to like it without the brackets, either? Maybe "nasm-users" doesn't like me... Anyway... I tried the following experiment... Since I don't "do" C (much), I made up a "fake" kmain, which simply prints the letter "K" on the screen and returns. Assembled with "-f obj". Added a "..start:" label to "test_kernel2", and assembled that with "-f obj". Since I've got Alink working under Linux, I tried to link 'em with "alink -oCOM test_kernel2.obj kmain.obj". Alink warns that it's discarding data at offset... well, all of 'em... and produces a zero-length .com file. That's not going to help. So tried "-oEXE". Got an .exe! Since I don't have an MZ loader at hand, nor "exe2bin" (which might work), I simply removed the header with a text editor. The offsets happened to work out - I doubt if this will always be true! I think we're going to need a proper MZ loader to handle relocations, eventually. But for now... I combined "boot.bin" with this result using "cat", and wrote the resulting "image.bin" to floppy. Wrote that to floppy with "dd". Booted, and after "Welcome to the kernel", saw 'K' printed... repeatedly. Progress! This isn't exactly what you want to do, but leads me to believe that, with the proper tools, it may not be as difficult as I imagined. (famous last words...) Best, Frank |
From: H. P. A. <hp...@zy...> - 2009-07-09 15:13:49
|
zak100 wrote: > Hi, > I am trying to call 'C" functions from my tiny kernel code. Can somebody plz > help me with this? > ; call c function > extern [_K_main] That should be extern _K_main No brackets... -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf. |
From: zak100 <zul...@ya...> - 2009-07-09 06:37:02
|
Hi, I am trying to call 'C" functions from my tiny kernel code. Can somebody plz help me with this? ; call c function extern [_K_main] ;--- test kernel.bin--- ; push cs ; push cs ; pop ds ; pop es mov ax, 7E0H mov ds,ax mov es,ax mov si, msg mov ah, 0Eh mov bx, 7 top: lodsb cmp al, 0 jz blackhole int 10h jmp short top blackhole: mov cx,1000 Delay: Loop Delay call _K_main; this is in main.c hlt jmp blackhole msg db 'Welcome to the Kernel!', 0 times 0x200-($-$$) db 0 I am getting following error mesg: D:\nasm prog>nasm -f bin -o boot.bin test_kernel2.asm test_kernel2.asm:5: error: label or instruction expected at start of line D:\NASMPR~1> Zulfi. -- View this message in context: http://www.nabble.com/calling-%27C%27-functions-tp24404865p24404865.html Sent from the nasm-users mailing list archive at Nabble.com. |
From: Frank K. <fbk...@zy...> - 2009-06-29 14:35:31
|
zak100 wrote: This is the problem: > mov ax,0B800h > mov es,ax ; One example you've got puts characters to screen memory, at B800h:????. "stosw" is used to put character and color to es:di. The other example uses bios int 10h, subfunction 13h, which expects es:bp to point to the string (unusual parameters to this interrupt!). (the tut you've got explains other parameters to this int, but fails to mention the es:bp thing) When our bootsector receives control from the bios, we don't know what ds and es are. If we've assembled at "org 0", we want them to be 7C0h. If we've assembled at 7C00h, we want them to be zero... to refer to any data in our bootsector (if we want screen memory, 0B800h - an old ttl mono card wants 0B000h - we probably won't encounter such a thing, but really should check... int 11h, IIRC). The example that prints registers on the screen, is quite "non-standard", and probably isn't a good starting point for other bootsectors. This one uses a different int 10h subfunction, 0Eh, which prints the character in al (put there by lodsb). ;------------------------------------ ; same as boot01, pretty much... ; nasm -f bin -o boot01.bin boot01.asm ; dd count=1 if=boot01.bin of=/dev/fd0 ;------------------------------------- org 7C00h section .text jmp short overdata nop db 'MyOS ' ; OEM id dw 200h ; bytes/sector db 1 ; sectors per cluster dw 1 ; sectors before FAT db 2 ; number of FATs dw 0E0h ; max rootdir entries dw 0B40h ; total sectors db 0Fh ; media descriptor dw 9 ; sectors per FAT dw 12h ; sectors per track dw 2 ; number heads times 0Ah db 0 db 29h db 0EFh db 7 db 10h db 24h db 'LINUX BOOT FAT12 ' ;---------------------------- overdata: xor ax,ax mov ds,ax mov es,ax ; should probably set up a sane stack here, too. mov si,msg ; "our dear string" mov bx,7 mov ah,0Eh msgloop: lodsb or al,al jz blackhole int 10h ; since we're still in RM, we can use bios. jmp msgloop blackhole: jmp blackhole msg db "We be bootin'2!",0 times 510-($-$$) db 90h ; don't think it matters, but we'll use NOP db 55h,0AAh ; boot sector signature ;------------------------- I'll see if I can work up an example using int 10h subfunction 13h... maybe even set up the stack, instead of just saying we should. :) Won't be immediately, but I'll try to get to it "soon"... Best, Frank |
From: zak100 <zul...@ya...> - 2009-06-29 09:45:43
|
Hi, I have written the following program to be exeuted when my system boots up using int 10h. But its not printing any mesg. Can somebody plz. help me with this?? Zulfi. org 7C00h; starting the program at 7C00H. Address generated at reset section .text section .text; why twice???? call overdata ; Call? WTF? Don't worry, we pop the. ; return address off to get initial IP. ; Note that "call" is longer than ; nop ; "jmp short", so we don't want the nop. At 7C00H we have to make a jmp where our actual code starts db 'MyOS ' ; OEM id - space-padded to 8 bytes dw 200h ; bytes/sector db 1 ; sectors per cluster dw 1 ; sectors before FAT db 2 ; number of FATs dw 0E0h ; max rootdir entries dw 0B40h ; total sectors db 0Fh ; media descriptor dw 9 ; sectors per FAT dw 12h ; sectors per track dw 2 ; number heads times 0Ah db 0 db 29h db 0EFh db 7 db 10h db 24h db 'LINUX BOOT FAT12 ' ; guess where I ; cribbed this from ;----------------------------writing a mesg on screen at startup. We cant use int 21h overdata: xor di,di mov ds,di mov ax,0B800h mov es,ax ; should probably set up a sane stack here, too. ;mov ah,03h ;xor bh, bh ;int 10h ;---------------------------- mov cx, 15 mov bh,0 mov bl,0011_1011b mov bp, msg mov ax,1301h mov dl,10 mov dh,7 int 10h blackhole: jmp blackhole msg db "We be bootin2'!",0 times 510-($-$$) db 0 db 55h, 0AAh ; ??????I know times is like dup.But what is ($-$$) and 55h and 0AAh ; boot sector signature -- View this message in context: http://www.nabble.com/prob-with-bios-int-10h-tp24251227p24251227.html Sent from the nasm-users mailing list archive at Nabble.com. |
From: Frank K. <fbk...@zy...> - 2009-06-27 08:17:46
|
Zulfi Khan wrote: > Hi Frank, > I excuted writeit.com and it stored BOOT.BIN in drive 'a'. I got following mesg when i tried to see the directory of drive 'a' .All its files got removed after execution. > D:\NASMPR~1>dir a: > The volume does not contain a recognized file system. > Please make sure that all required file system drivers are loaded and that the v > olume is not corrupted. Well, it *is* corrupted! We just wrote a bootsector to it that doesn't have a Bios Parameter Block (BPB). This is the cruft at the beginning of the example I sent you: jmp short overdata nop Strictly speaking, a bootsector is "supposed" to start with either a near jump, or short jump / nop (three bytes). I have heard of one case (a laptop, I think) where a bios refused to boot without it. Most biosen ignore it - some don't even check the 55h/0AAh signature. If you want to "boot anywhere", you should really have it. If you just want to boot on your own machine, "whatever works". After these three bytes, the BPB starts with the vendor ID - exactly 8 bytes, space-padded. After that, some info that the File System depends on. db 'MyOS ' ; OEM id dw 200h ; bytes/sector db 1 ; sectors per cluster dw 1 ; sectors before FAT db 2 ; number of FATs dw 0E0h ; max rootdir entries dw 0B40h ; total sectors db 0Fh ; media descriptor dw 9 ; sectors per FAT dw 12h ; sectors per track dw 2 ; number heads times 0Ah db 0 db 29h db 0EFh db 7 db 10h db 24h db 'LINUX BOOT FAT12 ' ; guess where I ; cribbed this from ;---------------------------- overdata: ... I've got a better example - written by Deb Wiles - that I'll probably send you sooner or later. The above was... as I recall... read off a working floppy and beaten into Nasm syntax. I don't even know what some of the numbers mean, it "just works". Maybe can get by with less than that - gotta have "media descriptor", at least... If you had files on that floppy, you can do an experiment: assemble that example "nasm -f bin -o boot.bin boot02.asm" and "writeit". It *may* restore your files... if we haven't scribbled on the FAT (File Allocation Table - two of 'em) or the root directory. No harm tryin'. (the bootsector won't show up with "dir a:" in any case) But never mind that. Did you see the white-on-blue 'A'??? A fully working File System is a few steps down the line yet.. > However, I could not understand the two examples. Do I have to compile them and store them on drive 'a'? The "translation" of the as86 example and the "boot02.asm" example, yes. The "writeit.asm" wants to be assembled to a .com file and used to do the writing... I guess you figured that out. > I am also attaching part 2 and part 3. Excellent! Thank you! I've taken just a quick look at 'em. Looks like in part II, we introduce both bios interrupts, and loading a second sector. My "writeit" isn't going to work for that. I don't think his C code is going to open "/dev/fd0" in dos/doze (he's as sloppy as I am with not checking for errors!!!) We can figure something out, if you get that far. In part III, different authors, and we switch to Nasm (Yay! Although I don't see the code...), and get into protected mode. IMHO, it's a mistake to get into pmode too early - you haven't got interrupts any more! They mention doing "cli" to disable interrupts, but gloss over the fact that you've gotta write and install some before you can "sti" to turn 'em back on! Good enough to write something to the screen, I guess. Mike Gonta has proven me wrong on this. I thought he got into pmode "too early", in his AEBios, but he goes on to load something else (the only sensible thing for a bootsector to do is load something else) by using just the ports. Interesting approach! http://aebios.com/ (for Fasm, not Nasm, but they're close) Here's something completely different - prints the value of the registers on bootup. The point being that they're *not* the same from one machine to another! (dl should always be boot drive) It isn't a "typical" bootsector, in that it starts with a "call" instead of the canonical "jmp short". I don't know if there's any point to it, but it'll give you something to play with. Have fun! (if you switched to Linux, it would solve the linking problem on that other file. :) there's one "problem" with Linux, I've found: I really don't like to reboot! So this is not recently tested...) Best, Frank ;------------------------------------ ; nasm -f bin -o boot.bin boot07.asm ; ; dd count=1 if=boot.bin of=/dev/fd0 ; or ; debug boot.bin ; w 100 0 0 1 ; q ; or "writeit" :) ;------------------------------------- org 7C00h section .text section .text call overdata ; Call? WTF? Don't worry, we pop the ; return address off to get initial IP. ; Note that "call" is longer than ; nop ; "jmp short", so we don't want the nop db 'MyOS ' ; OEM id - space-padded to 8 bytes dw 200h ; bytes/sector db 1 ; sectors per cluster dw 1 ; sectors before FAT db 2 ; number of FATs dw 0E0h ; max rootdir entries dw 0B40h ; total sectors db 0Fh ; media descriptor dw 9 ; sectors per FAT dw 12h ; sectors per track dw 2 ; number heads times 0Ah db 0 db 29h db 0EFh db 7 db 10h db 24h db 'LINUX BOOT FAT12 ' ; guess where I ; cribbed this from ;---------------------------- overdata: push sp ; note that we're doing all these push ss ; pushes to a "wild" stack. Not push es ; good. (0000:03FA on my system - yipes!) push ds ; In a real boot-sector, I'd set up a push cs ; sane stack - very first thing! push bp push si push di push dx push cx push bx push ax mov ax, 0B800h ; screen memory - we assume not mono mov es, ax ; also not good. xor di, di mov ds, di mov cx, 80 * 25 * 2 rep stosb ; clear screen (al is zero from above) mov di, 80 * 5 * 2 mov cx, 13 ; hmmm - could just do cl - a byte! mov si, regnames nextreg: push cx ; save reg-loop counter mov cx, 5 ; char counter for names mov ah, 3 ; color nextchar: lodsb stosw loop nextchar pop cx ; reg-loop counter pop dx ; value of reg mov bx, 4 ; nibble loop counter nextnibble: rol dx, 4 ; rotate a nibble into position mov al, dl ; make a copy to process mov ah, 03h ; color and al, 0Fh ; isolate nibble cmp al, 10 ; short way to convert a nibble sbb al, 69h ; to hex ascii das stosw ; write char and attribute to screen dec bx ; loop counter for nibbles jnz nextnibble add di, 80 * 2 - 18 ; next line loop nextreg blackhole: jmp blackhole regnames: db 'ax = ' db 'bx = ' db 'cx = ' db 'dx = ' db 'di = ' db 'si = ' db 'bp = ' db 'cs = ' db 'ds = ' db 'es = ' db 'ss = ' db 'sp = ' db 'ip = ' times 510-($-$$) db 90h ; don't think it matters, but we'll use NOP db 55h, 0AAh ; boot sector signature ;------------------------- |
From: H. P. A. <hp...@zy...> - 2009-06-26 06:25:17
|
Ermin Robert Alegrid wrote: > It's because you're trying to use Microsoft's linker with an ELF file. link.exe does not support ELF. Either switch to MS's object file format (/f win32), or use a linker which supports ELF (like ld.exe). Not to mention that int 80h is a Linux system call, which is hardly something you want to use under anything where you could possibly run the Microsoft linker. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf. |
From: Ermin R. A. <e.a...@st...> - 2009-06-26 03:40:08
|
It's because you're trying to use Microsoft's linker with an ELF file. link.exe does not support ELF. Either switch to MS's object file format (/f win32), or use a linker which supports ELF (like ld.exe). -----Original Message----- From: zak100 <zul...@ya...> To: nas...@li... Date: Thu, 25 Jun 2009 06:31:37 -0700 (PDT) Subject: Re: [Nasm-users] compiling with as86 Hi, I have acted on Frank's advice and downloaded the nasm assembler. I have also downloaded the Linker Lnk563. I have tried to compile a simple program which I got from internet but I faced prob. in execution. section .data hello: db 'Hello world!',10 ; 'Hello world!' plus a linefeed character helloLen: equ $-hello ; Length of the 'Hello world!' string ; (I'll explain soon) section .text global _start _start: mov eax,4 ; The system call for write (sys_write) mov ebx,1 ; File descriptor 1 - standard output mov ecx,hello ; Put the offset of hello in ecx mov edx,helloLen ; helloLen is a constant, so we don't need to say ; mov edx,[helloLen] to get it's actual value int 80h ; Call the kernel mov eax,1 ; The system call for exit (sys_exit) mov ebx,0 ; Exit with return code of 0 (no error) int 80h The compiling went fine: D:\NASMPR~1>nasm -f elf nasm1.asm D:\NASMPR~1> But linking failed. D:\NASMPR~1>Link nasm1.o Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994 Copyright (C) Microsoft Corp 1984-1993. All rights reserved. Run File [nasm1.exe]: dir List File [nul.map]: nasm1.o : fatal error L1023: terminated by user D:\NASMPR~1>Link nasm1.o Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994 Copyright (C) Microsoft Corp 1984-1993. All rights reserved. Run File [nasm1.exe]: List File [nul.map]: Libraries [.lib]: Definitions File [nul.def]: nasm1.o : fatal error L1101: invalid object module Object file offset: 1 Record type: 7f D:\NASMPR~1> Zulfi. Frank Kotler-3 wrote: > > zak100 wrote: > > Hi, > > I have downloaded the file as86-0.16.17.tar. After extracting, I > found lots > > of c programs and header file along with some other files. Can > somebody help > > me and let me know, how to compile using as86? > > > > Zulfi. > > Hi Zulfi, > > As hpa has pointed out, this isn't "on topic" for the nasm-devel list. > I've "transfered" you to the nasm-users list. It isn't on topic here, > either, but we're really desperate for traffic. :) I reject "help for > the fat and limp" every day, and I'd *really* like to approve a message > once in a while! > > The easy answer to your question is: type "make install". If that > results in a cascade of error messages instead of installing a86, tell > us what it says... maybe we can help, maybe not... > > You'll probably(?) want ld86 also - part of the "bin86" package, > apparently. "make install" should work for that, too (it says in the > glossy brochure). (both as86 and ld86 already exist on my system - > elderly Slackware Linux - try just typing "as86" and see what happens) > > Now I've got a question for you. Why in hell do you *want* to use > as86??? It is quite "obsolete", AFAIK. I guess ELKS uses it still(?). I > think it was required to build the Linux bootsector, long ago. I see > references to as86 in "coreboot"... dunno what that is... > > If you've got some code intended for as86 - probably a bootsector? - and > would like to "port" it to Nasm, we can probably help with that. (would > be "on topic", even!) That might be easier than messing with as86/ld86, > depending on what you're trying to do. > > Whatever you're trying to do, good luck with it! Let us know how it goes. > > Best, > Frank > > > ------------------------------------------------------------------------------ > _______________________________________________ > Nasm-users mailing list > Nas...@li... > https://lists.sourceforge.net/lists/listinfo/nasm-users > > -- View this message in context: http://www.nabble.com/compiling-with-as86-tp24198376p24203329.html Sent from the nasm-users mailing list archive at Nabble.com. -------------------------------------------- Robert Alegrid #3164658 BP-079 Bachelor of Science (Physics) BP-083 Bachelor of Applied Science (Mathematics) |
From: Frank K. <fbk...@zy...> - 2009-06-25 14:28:40
|
Zulfi Khan wrote: > Hi Frank, > I have now downloaded nasm and the linker Link53.exe. I have to do something as described in the attached article. Let me know if its fine. Okay. I don't think you'll need the linker at this stage. Won't hurt. The fact that you got an .exe suggests that you're not running Linux, as the article assumes. You can do it anyway - you may need a different method to write your bootsector to floppy. That can be arranged. [snip] > 3.1 The Boot Sector > > Grab your favourite editor and type in these few lines. > > || > > entry start > start: > mov ax,#0xb800 > mov es,ax > seg es > mov [0],#0x41 > seg es > mov [1],#0x1f > loop1: jmp loop1 > > This is an assembly language that as86 will understand. Nasm will require a slight change in syntax: ;------------------ mov ax, 0xb800 mov es, ax mov byte [es:0], 0x41 mov byte [es:1], 0x1f loop1: jmp loop1 times 510 - ($ - $$) db 0 db 0x55, 0xAA ;------------ The last two lines do not appear in Mr. Krishnakumar's code. He adds the "boot signature" in his C loader code. These lines pad the file out to 512 bytes, and put the two-byte signature in its proper spot (if I got it right... been a while since I did this...) This way you won't need a "special" loader. Save this as "boot0.asm", and assemble with "nasm -f bin -o boot.bin boot1.asm" (or pick your own names). Hopefully, that will result in "boot.bin", 512 bytes long. Now you need to write this to the first sector of a floppy. You could use Mr. Krishnakumar's code... but if you're running Linux, you could just do "dd if=boot.bin of=/dev/fd0"... and if you're not running Linux, his code won't work either... If you're running some version of Windows that includes dos, you could use John Fine's "partcopy" (pcopy02.zip): http://files.osdev.org/mirrors/geezer/johnfine/ Or rawwrite: http://www.filewatcher.com/m/rawwrite.exe.378368.0.0.html Or "debug boot.bin"/"w 100 0 0 1"/"q" Or... ;-------------------------- ; nasm -f bin -o writeit.com writeit.asm [BITS 16] [ORG 0x100] mov ax,3D00h mov dx,filename int 21h ; check for errors here! mov bx,ax mov ah,3Fh mov dx,buffer mov cx,512 int 21h ; check for errors here! mov ah,3Eh int 21h push ds pop es mov bx, buffer mov dl, 00h mov dh, 0 mov cl, 1 mov ch, 0 mov ah, 03h mov al, 1 int 13h ; check for errors here! mov ax, 4C00h int 21h filename db 'BOOT.BIN',0 buffer times 512 db 0 ;--------------------------- As you can see, this is extremely rudimentary - reads "boot.bin" (no options) and writes it to drive A: (no options). If all doesn't go well, it just plain fails (this could all be easily fixed... but I'm pretty lazy). It is a simple way to do it. [snip] > From here, we'll want to insert more code into our boot sector program, > to make it do more complex things (like using BIOS interrupts, > protected-mode switching, etc). The later parts (PART II, PART III etc. > ) of this article will guide you on further improvements. Till then GOOD > BYE ! As I recall, I never found "PART II, etc.". Have you? If not, and if you need some more examples, I might be able to find some... Here's one: ;------------------------------------ ; nasm -f bin -o boot.bin boot02.asm ; ; dd count=1 if=boot.bin of=/dev/fd0 ; or ; debug boot.bin ; w 100 0 0 1 ; q ;------------------------------------- org 7C00h section .text jmp short overdata nop db 'MyOS ' ; OEM id dw 200h ; bytes/sector db 1 ; sectors per cluster dw 1 ; sectors before FAT db 2 ; number of FATs dw 0E0h ; max rootdir entries dw 0B40h ; total sectors db 0Fh ; media descriptor dw 9 ; sectors per FAT dw 12h ; sectors per track dw 2 ; number heads times 0Ah db 0 db 29h db 0EFh db 7 db 10h db 24h db 'LINUX BOOT FAT12 ' ; guess where I ; cribbed this from ;---------------------------- overdata: xor ax,ax mov ds,ax mov ax,0B800h mov es,ax ; should probably set up a sane stack here, too. mov si,msg ; "our dear string" mov ah,04h ; color msgloop: lodsb or al,al jz blackhole stosw jmp msgloop blackhole: jmp blackhole msg db "We be bootin'!",0 times 510-($-$$) db 0 db 55h, 0AAh ; boot sector signature ;------------------------- The initial cruft is for FAT12 compatibility - not necessary, but it keeps debug happier, if you're using that (otherwise you'll have to format the disk every time). Then, first thing, we initialize ds to a correct value (could also use "org 0" and load ds with 7C0h). It may be that your BIOS will leave ds with the "right" value, but some of 'em don't, so don't count on it! Mr. Krishnakumar's example doesn't depend on this, so you don't have to do it there, but as soon as you've got "data", you'll need it. I'm cc'ing your messages to the nasm-users list, but I didn't tell ya how to post to it: Nasm-users mailing list Nas...@li... https://lists.sourceforge.net/lists/listinfo/nasm-users You may have more questions... :) Best, Frank |
From: zak100 <zul...@ya...> - 2009-06-25 14:09:05
|
Hi, I have acted on Frank's advice and downloaded the nasm assembler. I have also downloaded the Linker Lnk563. I have tried to compile a simple program which I got from internet but I faced prob. in execution. section .data hello: db 'Hello world!',10 ; 'Hello world!' plus a linefeed character helloLen: equ $-hello ; Length of the 'Hello world!' string ; (I'll explain soon) section .text global _start _start: mov eax,4 ; The system call for write (sys_write) mov ebx,1 ; File descriptor 1 - standard output mov ecx,hello ; Put the offset of hello in ecx mov edx,helloLen ; helloLen is a constant, so we don't need to say ; mov edx,[helloLen] to get it's actual value int 80h ; Call the kernel mov eax,1 ; The system call for exit (sys_exit) mov ebx,0 ; Exit with return code of 0 (no error) int 80h The compiling went fine: D:\NASMPR~1>nasm -f elf nasm1.asm D:\NASMPR~1> But linking failed. D:\NASMPR~1>Link nasm1.o Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994 Copyright (C) Microsoft Corp 1984-1993. All rights reserved. Run File [nasm1.exe]: dir List File [nul.map]: nasm1.o : fatal error L1023: terminated by user D:\NASMPR~1>Link nasm1.o Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994 Copyright (C) Microsoft Corp 1984-1993. All rights reserved. Run File [nasm1.exe]: List File [nul.map]: Libraries [.lib]: Definitions File [nul.def]: nasm1.o : fatal error L1101: invalid object module Object file offset: 1 Record type: 7f D:\NASMPR~1> Zulfi. Frank Kotler-3 wrote: > > zak100 wrote: > > Hi, > > I have downloaded the file as86-0.16.17.tar. After extracting, I > found lots > > of c programs and header file along with some other files. Can > somebody help > > me and let me know, how to compile using as86? > > > > Zulfi. > > Hi Zulfi, > > As hpa has pointed out, this isn't "on topic" for the nasm-devel list. > I've "transfered" you to the nasm-users list. It isn't on topic here, > either, but we're really desperate for traffic. :) I reject "help for > the fat and limp" every day, and I'd *really* like to approve a message > once in a while! > > The easy answer to your question is: type "make install". If that > results in a cascade of error messages instead of installing a86, tell > us what it says... maybe we can help, maybe not... > > You'll probably(?) want ld86 also - part of the "bin86" package, > apparently. "make install" should work for that, too (it says in the > glossy brochure). (both as86 and ld86 already exist on my system - > elderly Slackware Linux - try just typing "as86" and see what happens) > > Now I've got a question for you. Why in hell do you *want* to use > as86??? It is quite "obsolete", AFAIK. I guess ELKS uses it still(?). I > think it was required to build the Linux bootsector, long ago. I see > references to as86 in "coreboot"... dunno what that is... > > If you've got some code intended for as86 - probably a bootsector? - and > would like to "port" it to Nasm, we can probably help with that. (would > be "on topic", even!) That might be easier than messing with as86/ld86, > depending on what you're trying to do. > > Whatever you're trying to do, good luck with it! Let us know how it goes. > > Best, > Frank > > > ------------------------------------------------------------------------------ > _______________________________________________ > Nasm-users mailing list > Nas...@li... > https://lists.sourceforge.net/lists/listinfo/nasm-users > > -- View this message in context: http://www.nabble.com/compiling-with-as86-tp24198376p24203329.html Sent from the nasm-users mailing list archive at Nabble.com. |
From: Frank K. <fbk...@zy...> - 2009-06-25 07:28:56
|
zak100 wrote: > Hi, > I have downloaded the file as86-0.16.17.tar. After extracting, I found lots > of c programs and header file along with some other files. Can somebody help > me and let me know, how to compile using as86? > > Zulfi. Hi Zulfi, As hpa has pointed out, this isn't "on topic" for the nasm-devel list. I've "transfered" you to the nasm-users list. It isn't on topic here, either, but we're really desperate for traffic. :) I reject "help for the fat and limp" every day, and I'd *really* like to approve a message once in a while! The easy answer to your question is: type "make install". If that results in a cascade of error messages instead of installing a86, tell us what it says... maybe we can help, maybe not... You'll probably(?) want ld86 also - part of the "bin86" package, apparently. "make install" should work for that, too (it says in the glossy brochure). (both as86 and ld86 already exist on my system - elderly Slackware Linux - try just typing "as86" and see what happens) Now I've got a question for you. Why in hell do you *want* to use as86??? It is quite "obsolete", AFAIK. I guess ELKS uses it still(?). I think it was required to build the Linux bootsector, long ago. I see references to as86 in "coreboot"... dunno what that is... If you've got some code intended for as86 - probably a bootsector? - and would like to "port" it to Nasm, we can probably help with that. (would be "on topic", even!) That might be easier than messing with as86/ld86, depending on what you're trying to do. Whatever you're trying to do, good luck with it! Let us know how it goes. Best, Frank |
From: Frank K. <fbk...@zy...> - 2009-05-10 18:03:42
|
Yulia86 wrote: > Hi! Help to write a program code on assembler TMS320C6x! > In ЯП 28 to place the sum of positive and even words under number, and in ЯП > 29 sum of negative and odd words under number. I don't think Nasm will help you with this. There's a project with some tools here: http://c6x-tools.sourceforge.net/ Doesn't look as if it's progressed too far. There's a !YAHOO! group here: http://tech.groups.yahoo.com/group/c6x/ Might get more help there. Looks to me like this chip is mostly programmed in C, rather than assembly... (no reason *that* has to continue! :) Best, Frank |
From: Yulia86 <bur...@ya...> - 2009-05-10 16:18:48
|
Hi! Help to write a program code on assembler TMS320C6x! In ЯП 28 to place the sum of positive and even words under number, and in ЯП 29 sum of negative and odd words under number. -- View this message in context: http://www.nabble.com/Algorithm-I-understand.-tp23471578p23471578.html Sent from the nasm-users mailing list archive at Nabble.com. |
From: Frank K. <fbk...@zy...> - 2009-05-08 02:33:29
|
oh...@co... wrote: > Hi, > > To answer your question: I'm using the MS linker from Visual Studio 2008. Googling "nasm visual studio" comes up with a few links... The gist of it seems to be: --------------------------- Integration within Microsoft Visual Studio 6 Since 0.95.36, NASM is fully officially compatible with Microsoft Visual Studio 6 / .NET - In Tools/Options/Directories, Select 'Show directories for:' into 'Executable files'. Add a new path "C:\Program Files\NASM" (or where you have installed Nasm) - In your project workspace, create a new folder 'Assembler Files'. - On this folder, right click and select 'Settings.' - In General, enable 'Always use custom build step'. - In Custom Build, change the following settings : Integration within Microsoft Visual .NET 2003 - In Tools/Options/Projects, Select 'VC++ Directories ' and 'Show directories for:' 'Executable files' - Should be the default. Press Ctrl-Insert or press the 'New Line' icon. Select the path "C:\Program Files\NASM" (or where you have installed Nasm) - In your project workspace, create a new folder 'Assembler Files'. - On this folder, right click and select 'Settings.' - In General, enable 'Always use custom build step'. - In Custom Build, change the following settings : Commands nasmw.exe -f win32 -Xvc -o "$(IntDir)\$(InputName).obj" $(InputDir)\$(InputName).asm Outputs "$(IntDir)\$(InputName).obj" --------------------------- The reference to "fully compatible" only means the "-Xvc" option, which switches error messages to a format MS tools like - a case of parentheses around the line number, IIRC. Will make a difference within the IDE, otherwise not, I think. > So, are you saying that I can eliminate both the "extern" and the "import"? No, just the "import". Pretty sure you'll still need the "extern"... although it is sometimes hidden in the macros in an .inc file. The above instructions don't mention anything about the linker. I found this "raw" example from Matt Taylor... (I don't think we need the "bits 32" - won't hurt) ------------ bits 32 extern __imp__ExitProcess@4 section .text _start: push 0 call [__imp__ExitProcess@4] I assemble and link like this: nasm -f win32 win32test.asm -o win32test.obj link /ENTRY:start /SUBSYSTEM:console win32test.obj kernel32.lib /OUT:win32test.exe ------------------------- This assumes you've got "kernel32.lib"... part of VS?... in a lib/ directory, most likely... Note that the names are "decorated" (mutilated) even more than what Robert shows. I *think* we can either "call _FooApi@?" or "call [__IMP__FooApi@?]" - the number is the number of bytes of parameters expected (removed, unseen by us, in the called function... except for variadic functions like printf, and *maybe* all C functions - as opposed to Windows APIs... in "msvc32.dll"???) Again, I think it is "usual" to have some of the "renaming" hidden away in a macro in an .inc file. I'd try it "raw" first - might take some experimentation - so you understand what's "really" happening. Good Luck! Best, Frank |
From: Ermin R. A. <e.a...@st...> - 2009-05-07 23:10:19
|
If I recall correctly, whenever I tried to use Win32 in my asm code I had to: a) use extern _MessageBoxA@16 (or whatever function I used) b) add User32.lib (or appropriate import library) to the linker Check up on stdcall name decorating if you're wondering why MessageBoxA is like that. Hope that helps, Robert -----Original Message----- From: <oh...@co...> To: Frank Kotler <fbk...@zy...> Date: Thu, 7 May 2009 5:52:23 -0400 Subject: Re: [Nasm-users] How to call MessageBoxA from Nasm program? Hi, To answer your question: I'm using the MS linker from Visual Studio 2008. So, are you saying that I can eliminate both the "extern" and the "import"? Thanks, Jim ---- Frank Kotler <fbk...@zy...> wrote: > oh...@co... wrote: > > Hi, > > > > I'm trying to add a call to MessageBoxA in a Nasm app. I know how to setup the parameters for the call, but I can't get Nasm to assemble successfully. > > > > I have added an "extern MessageBoxA" and "import MessageBoxA user32.dll" (this is on Windows), but when I do that, I get an error from parser saying that an instruction is expected. > > > > If I comment out the "import" line, I get a linker error. > > > > Am I not suppose to use both the "extern" and "import" lines, before the .Code line? > > Mmmm, yes, but only in "-f obj" output format (which defaults to 16-bit > and requires some "cruft" to tell Nasm we want 32-bit). Supposedly, in > "-f win32" format, we "don't need" it. I think the reason we "don't > need" it is that we are expected to link with an "import library" on the > linker command line. I am told that we can create our own import library > by assembling "extern MessageBoxA" and "import MessageBoxA user32.dll" > (with other extern/imports we need, presumably) as "-f obj" and linking > the produced .obj with the .obj containing your code (assembled as "-f > win32") - despite the different linkable object formats, this is > supposed to work. I was told this after I'd quit running Windows, so > never had a chance to try it. I think the more "usual" way would be to > link against an import library supplied with your linker(?). This raises > the obvious question: which linker are you using? And what, if anything, > came with it? I don't know much about Windows linkers - I used Alink, > mostly, for the few Windows programs I tried. I think Golink and Polink > are more common these days. > > You might want to download the "nasmx" package: > > http://www.asmcommunity.net/projects/nasmx/ > > Recent versions have been in .exe format, so I can't even look at it to > see what's there. Uses Golink, it says that on the web page... If it > doesn't include a "win32.lib" or such, the examples may give you an idea > how to function without it. > > If all else fails... > > http://home.comcast.net/~fbkotler/win32nasmbase.zip > > ...as I recall, that includes a library that worked with "-f win32", > although it is extremely old and obsolete... > > This question about "import" comes up fairly often, and I don't really > have a "good" answer to it, besides "it's for -f obj only" and we "don't > need" it for -f win32... Anyone got a clearer idea on this? > > Best, > Frank > > ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Nasm-users mailing list Nas...@li... https://lists.sourceforge.net/lists/listinfo/nasm-users -------------------------------------------- Robert Alegrid #3164658 BP-079 Bachelor of Science (Physics) BP-083 Bachelor of Applied Science (Mathematics) |
From: <oh...@co...> - 2009-05-07 09:52:35
|
Hi, To answer your question: I'm using the MS linker from Visual Studio 2008. So, are you saying that I can eliminate both the "extern" and the "import"? Thanks, Jim ---- Frank Kotler <fbk...@zy...> wrote: > oh...@co... wrote: > > Hi, > > > > I'm trying to add a call to MessageBoxA in a Nasm app. I know how to setup the parameters for the call, but I can't get Nasm to assemble successfully. > > > > I have added an "extern MessageBoxA" and "import MessageBoxA user32.dll" (this is on Windows), but when I do that, I get an error from parser saying that an instruction is expected. > > > > If I comment out the "import" line, I get a linker error. > > > > Am I not suppose to use both the "extern" and "import" lines, before the .Code line? > > Mmmm, yes, but only in "-f obj" output format (which defaults to 16-bit > and requires some "cruft" to tell Nasm we want 32-bit). Supposedly, in > "-f win32" format, we "don't need" it. I think the reason we "don't > need" it is that we are expected to link with an "import library" on the > linker command line. I am told that we can create our own import library > by assembling "extern MessageBoxA" and "import MessageBoxA user32.dll" > (with other extern/imports we need, presumably) as "-f obj" and linking > the produced .obj with the .obj containing your code (assembled as "-f > win32") - despite the different linkable object formats, this is > supposed to work. I was told this after I'd quit running Windows, so > never had a chance to try it. I think the more "usual" way would be to > link against an import library supplied with your linker(?). This raises > the obvious question: which linker are you using? And what, if anything, > came with it? I don't know much about Windows linkers - I used Alink, > mostly, for the few Windows programs I tried. I think Golink and Polink > are more common these days. > > You might want to download the "nasmx" package: > > http://www.asmcommunity.net/projects/nasmx/ > > Recent versions have been in .exe format, so I can't even look at it to > see what's there. Uses Golink, it says that on the web page... If it > doesn't include a "win32.lib" or such, the examples may give you an idea > how to function without it. > > If all else fails... > > http://home.comcast.net/~fbkotler/win32nasmbase.zip > > ...as I recall, that includes a library that worked with "-f win32", > although it is extremely old and obsolete... > > This question about "import" comes up fairly often, and I don't really > have a "good" answer to it, besides "it's for -f obj only" and we "don't > need" it for -f win32... Anyone got a clearer idea on this? > > Best, > Frank > > |