OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 4:05 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: NASM 2.00rc1
PostPosted: Sat Nov 17, 2007 1:40 am 
Offline
Member
Member

Joined: Sun Jun 18, 2006 7:21 pm
Posts: 260
NASM has now approached release candidate status. All major bugs on the path to adding x64 support have been squashed.

For those who use NASM, we would appreciate testing the Latest Build in your programming environment/setup so we can attend to any more potential bugs and finally push out an official 2.0 release.

Thanks for your attention and support :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 3:26 am 
Offline
Member
Member
User avatar

Joined: Sat Nov 25, 2006 3:55 am
Posts: 416
Location: Wisconsin
Spook,

I can not access FTP in University's residences. I would appreciate it if you could, please, post a link to images served on HTTP.

_________________
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 9:08 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
I tried porting my kernel from yasm to nasm, but it gave three different sets of issues. First I'm flooded with this:

Code:
inc_ia.asm:44: warning: numeric constant 0x0000007fc0000000 does not fit in 32 bits
inc_ia.asm:45: warning: numeric constant 0x0000ff8000000000 does not fit in 32 bits
inc_kernel.asm:44: warning: numeric constant 0x4000000000000000 does not fit in 32 bits
inc_kernel.asm:45: warning: numeric constant 0x8000000000000000 does not fit in 32 bits
inc_kernel.asm:46: warning: numeric constant 0xC000000000000000 does not fit in 32 bits
a test case
Code:
val EQU 0x0123456789ABCDEF
DQ val
assembled with the (in this case obviously pointless) warning on the EQU line, but produced exactly the same binary as yasm (the expected result) :?


The second set of errors regards CPU arguments, which is probably a feature of yasm's, but nasm chokes whenever you feed it CPU xxxxx FPU


The third is the most annoying problem since I can't easily fix it without having two different editions of the source files.
1) when a file is included, nasm will not look for that file in the directory where the main file is. (i.e. "nasm file.asm" works while "cd .." "nasm src/file.asm" does not)
2) I have to suffix a path with a trailing backslash to have nasm check in there (which cost me 10 minutes to figure out)

In all, I think I'll stick with yasm for now...

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 10:03 am 
Offline
Member
Member
User avatar

Joined: Sat Nov 25, 2006 3:55 am
Posts: 416
Location: Wisconsin
Combuster wrote:
I tried porting my kernel from yasm to nasm, but it gave three different sets of issues. First I'm flooded with this:

Code:
inc_ia.asm:44: warning: numeric constant 0x0000007fc0000000 does not fit in 32 bits
inc_ia.asm:45: warning: numeric constant 0x0000ff8000000000 does not fit in 32 bits
inc_kernel.asm:44: warning: numeric constant 0x4000000000000000 does not fit in 32 bits
inc_kernel.asm:45: warning: numeric constant 0x8000000000000000 does not fit in 32 bits
inc_kernel.asm:46: warning: numeric constant 0xC000000000000000 does not fit in 32 bits
a test case
Code:
val EQU 0x0123456789ABCDEF
DQ val
assembled with the (in this case obviously pointless) warning on the EQU line, but produced exactly the same binary as yasm (the expected result) :?


NASM, from what I know, using the 32-Bit mode, treats DD as DWORD and DQ as a 64-bit Floating point not an integral fixed point value. So:

Code:
DQ      123


Is not acceptable by NASM (at least in the version that I am using). I always find it really difficult to deal with 64-bit QWORD values in NASM for this reason. I remember that TASM Version 3.2 (16-bit) was able to deal with 64-bit QWORD values using the DQ and with 80-bit TBYTE values with the DT keywords. I wish these were also supported in NASM.

_________________
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 1:17 pm 
Offline
Member
Member

Joined: Sun Jun 18, 2006 7:21 pm
Posts: 260
Combuster wrote:
I tried porting my kernel from yasm to nasm, but it gave three different sets of issues. First I'm flooded with this:

Code:
inc_ia.asm:44: warning: numeric constant 0x0000007fc0000000 does not fit in 32 bits
inc_ia.asm:45: warning: numeric constant 0x0000ff8000000000 does not fit in 32 bits
inc_kernel.asm:44: warning: numeric constant 0x4000000000000000 does not fit in 32 bits
inc_kernel.asm:45: warning: numeric constant 0x8000000000000000 does not fit in 32 bits
inc_kernel.asm:46: warning: numeric constant 0xC000000000000000 does not fit in 32 bits
a test case
Code:
val EQU 0x0123456789ABCDEF
DQ val
assembled with the (in this case obviously pointless) warning on the EQU line, but produced exactly the same binary as yasm (the expected result) :?


At first glance, I would actually have to agree with you. However, I have notified the DEV team of this, as I cannot honestly/fully answer this one ATM due to my personal workload.

Combuster wrote:
The second set of errors regards CPU arguments, which is probably a feature of yasm's, but nasm chokes whenever you feed it CPU xxxxx FPU


Yes, this is unique to YASM. I can see how "CPU 387" and "CPU 487" could be useful, but it is a rather insignificant "feature" since the majority of CPUs include the x87 FPU.

At any rate, the DEV team will see your message, but don't get your hopes up.

Combuster wrote:
The third is the most annoying problem since I can't easily fix it without having two different editions of the source files.
1) when a file is included, nasm will not look for that file in the directory where the main file is. (i.e. "nasm file.asm" works while "cd .." "nasm src/file.asm" does not)
2) I have to suffix a path with a trailing backslash to have nasm check in there (which cost me 10 minutes to figure out)

In all, I think I'll stick with yasm for now...


This is standard practice, to treat relative files from the standpoint of the current working directory. Imagine having "data.asm" in both directories... with different content :oops:

Proper use of NASM's "-I" argument is highly suggested for these situations.

Thanks for the feedback, Combuster. I will let you know what the DEV team decides on all of these points ;)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 3:23 pm 
Offline
Member
Member

Joined: Sun Jun 18, 2006 7:21 pm
Posts: 260
Here is the responses from the DEV list, in respect to Combuster's points. The response to point 3 is also a comment/response by/to someone else in the DEV list.

H. Peter Anvin wrote:
1) Yes, he's complaining about the bogus warning here. I agree with him; it's broken.

2) We do, but overhauling NASM's handling of CPU feature sets (of which FPU is only one) is a fairly complex project. I have thought about this one a lot over the past six months, but I haven't had time for it (I've already spent way more time on NASM than I should.)

I would say it's something I really want to do, but not for 2.00. We
may want to add "387" and "487" as dummy options, though.

3) > NASM can't add the path of the input file name to
> > the include file path, because standard C doesn't
> > provide a way for extracting or obtaining the path
> > component of a file name. In fact, such a means
> > would be incompatible with certain OSs. (Thus it
> > is up to the user to provide a -I option, replicating
> > the path that is part of the input file name.)
> >
> > In this particular case, use -I src/ to make it work.
> >

We could do it by, in effect, maintaining a collection of known filename
syntaxes. Someone might very well have already done that already. But
yes, there is no portable way to do that.


So, to summarize. Point 1 will be fixed. Point 2 we'll get to. Point 3 is an issue with breaking standards and compatibility, so get used to doing things properly, instead.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 4:57 pm 
Offline

Joined: Sat Nov 17, 2007 4:29 pm
Posts: 1
Location: NH, USA
XCHG,

Like, drop out, maaaan! Go to a school that *does* let you ftp! :)

We just got 2.00rc1 up on SourceForge, so you should be all set.

http://sourceforge.net/project/showfile ... up_id=6208

On the other issues... I would point out that compatibility with Yasm has never been a design goal for Nasm. On the contrary. That said, we'll *try* to maintain compatibilty with Yasm... but it's not a "Nasm problem".

My understanding is that Nasm *is* supposed to accept a 64-bit integer as an argument to "dq" (unlike previous versions which accepted *only* a double-precision float). Watch for "rc2" on this one.

Nasm, at one point, *did* add a slash to the end of an "-I" (include path) parameter, if the user didn't supply either slash or backslash. This (mis)feature was removed, because it broke documented (as "perverse", but documented) behavior, which some people were apparently counting on. In general, I'd say do *not* expect Nasm to become "OS aware". It is deliberately ignorant... I mean "independent" of the OS it's running on.

Thanks to all for the feedback!

Best,
Frank


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 5:48 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
SpooK wrote:
So, to summarize. Point 1 will be fixed.
Wether or not I was the first, glad I could help.

Quote:
Point 2 we'll get to.
As I said, its a yasm feature. a quick search-and-replace would make that compatible with nasm, at the cost of an automatic bug check which it currently provides. (like, not using FPU code in kernel land)

Quote:
Point 3 is an issue with breaking standards and compatibility, so get used to doing things properly, instead.
Well, the yasm manual states
Quote:
The search path defaults to only including the directory in which the source file resides.
so I was doing things the right way. :roll: That nasm happens to do it different is a design choice I wont argue about (your arguments are completely valid, and so are the arguments to do it the other way), but it does force me to make a choice between the two assemblers as I can not support both properly without making ugly sacrifices in the makefile script.

While I do think you are doing a good job, I hope you can understand my decision to stick with yasm.

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 8:37 pm 
Offline
Member
Member

Joined: Sun Jun 18, 2006 7:21 pm
Posts: 260
Combuster wrote:
While I do think you are doing a good job, I hope you can understand my decision to stick with yasm.


Yep yep. Go with what you know... and thanks testing things out ;)


Top
 Profile  
 
 Post subject: NASM 2.00rc2
PostPosted: Tue Nov 20, 2007 11:18 am 
Offline
Member
Member

Joined: Sun Jun 18, 2006 7:21 pm
Posts: 260
Point 1 from this thread about NASM 2.00rc1 was indeed addressed, along with 9 other issues, thanks to the increased feedback we have been getting. Many thanks to those who have volunteered their time to help test NASM :)

All of the fixes have been implemented in NASM 2.00rc2 :idea:

Let the cycle begin again :P


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 1:41 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
Curious about the other issues, I found the following:
Quote:
2. Change EM64T to Intel 64 in Defining CPU Dependencies section of documentation.

Intel 64 / IA64 = Itanium :-k
(link)

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: NASM 2.00rc2
PostPosted: Tue Nov 20, 2007 3:43 pm 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
SpooK wrote:
Point 1 from this thread about NASM 2.00rc1 was indeed addressed, along with 9 other issues, thanks to the increased feedback we have been getting. Many thanks to those who have volunteered their time to help test NASM :)

All of the fixes have been implemented in NASM 2.00rc2 :idea:

Let the cycle begin again :P


Allow me to also vote for file working directory. If you cannot rely on having the same compilation environment no matter from where the program is being executed (IE - cwd independant except for finding the directly referenced files) your program cannot be used properly in adjustable makefiles or similar systems.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 5:29 pm 
Offline
Member
Member

Joined: Sun Jun 18, 2006 7:21 pm
Posts: 260
Combuster wrote:
Curious about the other issues, I found the following:
Quote:
2. Change EM64T to Intel 64 in Defining CPU Dependencies section of documentation.

Intel 64 / IA64 = Itanium :-k
(link)

IA-64 != Intel 64. Read THIS thread for more information as to why ;)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 6:00 pm 
Offline
Member
Member

Joined: Sun Jun 18, 2006 7:21 pm
Posts: 260
Forewarning: Some cross quoting between this thread and the DEV group.

H. Peter Anvin wrote:
Keith Kanios wrote:
http://www.osdev.org/phpBB2/viewtopic.p ... 058#111058

Candy wrote wrote:
Allow me to also vote for file working directory. If you cannot rely on having the same compilation environment no matter from where the program is being executed (IE - cwd independant except for finding the directly referenced files) your program cannot be used properly in adjustable makefiles or similar systems.


Anything official you want me to relay in response to the above???


NASM behaves the way most compilers (e.g. just about every C compiler) does in this respect. The way to deal with that in Makefiles is to use -I to point to your include directory.

-hpa


That's the official answer.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 2:06 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
SpooK wrote:
Forewarning: Some cross quoting between this thread and the DEV group.

H. Peter Anvin wrote:
Keith Kanios wrote:
http://www.osdev.org/phpBB2/viewtopic.p ... 058#111058

Candy wrote wrote:
Allow me to also vote for file working directory. If you cannot rely on having the same compilation environment no matter from where the program is being executed (IE - cwd independant except for finding the directly referenced files) your program cannot be used properly in adjustable makefiles or similar systems.


Anything official you want me to relay in response to the above???


NASM behaves the way most compilers (e.g. just about every C compiler) does in this respect. The way to deal with that in Makefiles is to use -I to point to your include directory.

-hpa


That's the official answer.


C offers the possibility of #include <> or #include "" for that very purpose. What about offering the same functionality, or if you don't see a way to do so, to offer only the second (which includes all of the first)?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 118 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group