flat assembler
Message board for the users of flat assembler.

Index > Heap > "Discussion" from the "fixups?" thread

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
Borsuc wrote:
Azu no offense mate, while I agree with doing stuff yourself and independent, in this case you are just wrong. Your method would be much more bloated, require much more memory, and probably much slower (though this I'm not sure).
???
It would only take a few dozen cycles, once, at startup.. how could that be worse than whatever Windows does?

Borsuc wrote:
Are you going to include the entire Windows API in every executable next time? That's what I call bloated... why do it? Wink
No. Just whatever my program is supposed to do. Like if it's supposed to add two numbers, I'm doing to use the "add" opcode instead of importing some OS-specific DLL and calling some function that only works in one OS.

For IO it makes sense to rely on the OS but that's about it.


Borsuc wrote:
BTW the PE format has nothing to do with an OS -- either a loader supports it or not. Even Linux supports it with Wine. It isn't "Windows specific", it is just a 'container' for code and data.
WINE isn't part of Linux. It's a reimplementation of Windows (like ReactOS, except it runs inside another OS) that lets you run pretty much any Windows proprietary executable. Doesn't make said Windows-only stuff any less Windows-only, just like VMware doesn't mean ELF runs on Windows.

Borsuc wrote:
Whether you like it or not, code and data must be in a container, which is a format. Binary, .com, ELF, PE, doesn't matter. And it has nothing to do with the OS -- that is, none of these formats have something SPECIFIC to an OS.
Yes but you can still try to avoid relying on certain features of those containers that are specific to certain OSs.

For example, if the OIP is all that you need from the container, your code is way more portable than if there is a bunch of proprietary gunk it needs from it (which would mean your code can't run except on the particular OSs that support it).

_________________
Post 17 Nov 2009, 02:05
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
You still don't realize that the OS does this automatically (well you need a reloc section, but that's about it). Any manual method would require more code and more memory in each executable.

Why not share a common fixup functionality from the OS? The OS's code is stored only ONCE in the user's machine, not on every exe out there... that's the whole point.

Azu wrote:
WINE isn't part of Linux. It's a reimplementation of Windows (like ReactOS, except it runs inside another OS) that lets you run pretty much any Windows proprietary executable. Doesn't make said Windows-only stuff any less Windows-only, just like VMware doesn't mean ELF runs on Windows.
WHAT? Laughing

Wine is an application. Consequently, it reads formats. PE is among them. PE is just a FORMAT, like jpg, png, gif, 3ds, max, etc...

Linux doesn't read it natively, so there's a program Wine that does. What's so wacky about that? What's so Windows specific about that?

I'm pretty sure Linux doesn't read max natively either, but with the right application (e.g: 3ds max under Wine Razz) it could. There's nothing "Windows" specific. Just because the Windows loader knows that format doesn't mean it's Windows specific or that it needs Windows stuff -- as it can be seen from Wine, a program under Linux.



If 3ds max can't run under Linux and nothing else can read max format, does that make the format Windows only? Not at all -- it's just that there's no app on Linux that can read it.

_________________
Previously known as The_Grey_Beast
Post 17 Nov 2009, 03:10
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
Borsuc wrote:
You still don't realize that the OS does this automatically (well you need a reloc section, but that's about it). Any manual method would require more code and more memory in each executable.
One particular OS might. But the topic was posted in main, which isn't for OS-dependent programming, is it?

Borsuc wrote:
Why not share a common fixup functionality from the OS? The OS's code is stored only ONCE in the user's machine, not on every exe out there... that's the whole point.
Because the more OS-specific stuff you rely on, the less portable your code is?

Borsuc wrote:
Azu wrote:
WINE isn't part of Linux. It's a reimplementation of Windows (like ReactOS, except it runs inside another OS) that lets you run pretty much any Windows proprietary executable. Doesn't make said Windows-only stuff any less Windows-only, just like VMware doesn't mean ELF runs on Windows.
WHAT? Laughing

Wine is an application. Consequently, it reads formats. PE is among them. PE is just a FORMAT, like jpg, png, gif, 3ds, max, etc...

Linux doesn't read it natively, so there's a program Wine that does. What's so wacky about that? What's so Windows specific about that?
Following that logic, console games aren't console specific, since there are "programs" for PCs that make them run.. Laughing

Borsuc wrote:
I'm pretty sure Linux doesn't read max natively either, but with the right application (e.g: 3ds max under Wine Razz) it could. There's nothing "Windows" specific. Just because the Windows loader knows that format doesn't mean it's Windows specific or that it needs Windows stuff -- as it can be seen from Wine, a program under Linux.
Ya.. um.. no.
You can make a program that emulates another OS, or installs another OS in a sandbox, or acts like another OS, but the fact still is, it's another OS, and there's nothing portable about it.



Borsuc wrote:
If 3ds max can't run under Linux and nothing else can read max format, does that make the format Windows only? Not at all -- it's just that there's no app on Linux that can read it.
An OS is the "program" that runs programs.

You can't compare that to some 3d modeling program. That's not what OSs do. OSs run programs.

_________________
Post 17 Nov 2009, 03:48
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
Quote:
r22 wrote:
If you want to make a meaningful point, make it in true programmer fashion, with a CODE EXAMPLE THAT COMPILES.
(Dare I suggest, it should even have a few comments that convey the meaning of said code example) DLL with fixups VS ~self readdressing code


My example is fine Smile it's just LE rather than PE.
Post 17 Nov 2009, 05:16
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
Azu wrote:
One particular OS might. But the topic was posted in main, which isn't for OS-dependent programming, is it?
It's a question for the PE format. Where do you see the word "OS" or "Windows" in there? I don't.

Azu wrote:
Because the more OS-specific stuff you rely on, the less portable your code is?
You mean the more format-specific your code is built on, but if you don't use the format fully it's like wasted.

This is where I disagree big time with you mate. Making programs use only common functionality doesn't fully utilize a given format's or CPU's specific architecture, which means, less optimized. Optimizations happen specifically for something.

Azu wrote:
Following that logic, console games aren't console specific, since there are "programs" for PCs that make them run.. Laughing
...yeah, unless you have to emulate hardware, which you probably need in that case. Then it's called a virtual machine. Smile

Azu wrote:
An OS is the "program" that runs programs.
An OS is a collection of programs. For example, right now we're talking about the loader program...

And I disagree about the OSes run programs part. CPUs run programs. Smile

_________________
Previously known as The_Grey_Beast
Post 17 Nov 2009, 20:03
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
Borsuc wrote:
Azu wrote:
One particular OS might. But the topic was posted in main, which isn't for OS-dependent programming, is it?
It's a question for the PE format. Where do you see the word "OS" or "Windows" in there? I don't.
The PE format is what programs in Windows use.

Borsuc wrote:
Azu wrote:
Because the more OS-specific stuff you rely on, the less portable your code is?
You mean the more format-specific your code is built on, but if you don't use the format fully it's like wasted.
No, I mean OS-specific, since that "format" is the proprietary executable format of Windows (and Windows clones like ReactOS/WINE/etc).

Borsuc wrote:
This is where I disagree big time with you mate. Making programs use only common functionality doesn't fully utilize a given format's or CPU's specific architecture, which means, less optimized. Optimizations happen specifically for something.
When the "format" is specific to one certain OS I think you shouldn't rely on it. And most of the code in Windows is not being optimized at all. It's made to run on pretty much any CPU since like 1980 lol (only, that's exaggerating a little).

Borsuc wrote:
Azu wrote:
Following that logic, console games aren't console specific, since there are "programs" for PCs that make them run.. Laughing
...yeah, unless you have to emulate hardware, which you probably need in that case. Then it's called a virtual machine. Smile
Emulating a whole OS is fine but emulating a chip isn't?

Borsuc wrote:
Azu wrote:
An OS is the "program" that runs programs.
An OS is a collection of programs. For example, right now we're talking about the loader program...
I'm talking about the kernel, the OS-specific libraries, and whatever part of the OS handles the running of all programs on it. I think it is safe to say these things are specific to the OS.

Borsuc wrote:
And I disagree about the OSes run programs part. CPUs run programs. Smile
The CPU sure doesn't run your programs. Name one CPU that implements ASLR, threading, SEH, and fixups. Laughing

_________________
Post 18 Nov 2009, 01:08
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
Azu wrote:
The PE format is what programs in Windows use.
Yeah. It also uses .bmp. Is that Windows specific too?

Azu wrote:
When the "format" is specific to one certain OS I think you shouldn't rely on it. And most of the code in Windows is not being optimized at all. It's made to run on pretty much any CPU since like 1980 lol (only, that's exaggerating a little).
Who cares? On Windows machines that code is there anyway.

And of course what other format do you want to use? If you program for Windows, why not use the extra features it gives you and make your program less bloated?

Striving for a common denominator is always a bad move. It may make it easily recompiled, but that's a sure sign of not being optimized for the target platform.

Azu wrote:
Emulating a whole OS is fine but emulating a chip isn't?
Wine Is Not an Emulator. It doesn't emulate anything. It's just a layer. ReactOS is not an emulator either, it's a re-implementation.

Wine isn't even an operating system, what are you talking about?

Azu wrote:
I'm talking about the kernel, the OS-specific libraries, and whatever part of the OS handles the running of all programs on it. I think it is safe to say these things are specific to the OS.
Uh yeah that's correct but the relocations is related to the PE format, not the Windows kernel. No one said that if you use a reloc section you have to use the Windows API for imports.

Azu wrote:
The CPU sure doesn't run your programs. Name one CPU that implements ASLR, threading, SEH, and fixups. Laughing
"running" a program means executing its code. What do fixups have to do with it? Windows just coordinates the whole thing.

_________________
Previously known as The_Grey_Beast
Post 18 Nov 2009, 02:06
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
Borsuc wrote:
Azu wrote:
The PE format is what programs in Windows use.
Yeah. It also uses .bmp. Is that Windows specific too?
Wrong. No operating system houses code in .bmp
Also, .bmp is not a proprietary container specific to the Windows OS.

Borsuc wrote:
Azu wrote:
When the "format" is specific to one certain OS I think you shouldn't rely on it. And most of the code in Windows is not being optimized at all. It's made to run on pretty much any CPU since like 1980 lol (only, that's exaggerating a little).
Who cares? On Windows machines that code is there anyway.
I'm pretty sure that Windows counts as a "particular operating system", sorry.

Borsuc wrote:
And of course what other format do you want to use? If you program for Windows, why not use the extra features it gives you and make your program less bloated?
Simple. Only use parts of the format that aren't OS-dependent. Like OEP and length.

Borsuc wrote:
Striving for a common denominator is always a bad move. It may make it easily recompiled, but that's a sure sign of not being optimized for the target platform.
Even if this is true (which it's not), so what? No matter how you word it, it's still specific to a particular OS.

Borsuc wrote:
Azu wrote:
Emulating a whole OS is fine but emulating a chip isn't?
Wine Is Not an Emulator. It doesn't emulate anything. It's just a layer. ReactOS is not an emulator either, it's a re-implementation.
Tomato tohmatoh.
dictionary definition of Emulator wrote:
1. to try to equal or excel; imitate with effort to equal or surpass: to emulate one's father as a concert violinist.
2. to rival with some degree of success: Some smaller cities now emulate the major capitals in their cultural offerings.
3. Computers.
a. to imitate (a particular computer system) by using a software system, often including a microprogram or another computer that enables it to do the same work, run the same programs, etc., as the first.
b. to replace (software)


Borsuc wrote:
Wine isn't even an operating system, what are you talking about?
It's a GUI-less implementation of Windows.

Borsuc wrote:
Azu wrote:
I'm talking about the kernel, the OS-specific libraries, and whatever part of the OS handles the running of all programs on it. I think it is safe to say these things are specific to the OS.
Uh yeah that's correct but the relocations is related to the PE format, not the Windows kernel. No one said that if you use a reloc section you have to use the Windows API for imports.
What are you even trying to say here?
PE is the internal executable format of the Windows operating system. If you are relying on specialized features of it, you are realizing on specialized features of this one particular operating system. Stop playing mind games already.

Borsuc wrote:
Azu wrote:
The CPU sure doesn't run your programs. Name one CPU that implements ASLR, threading, SEH, and fixups. Laughing
"running" a program means executing its code. What do fixups have to do with it? Windows just coordinates the whole thing.
Okay. So if my program relies on all of this stuff specific to the Windows operating system, it will run on other OSs too, since they "just" have to "coordinate" it or something trivial like that? Laughing
It won't be specific "to any particular operating system"? Laughing

_________________
Post 18 Nov 2009, 02:17
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
Azu frankly I don't understand what you are saying. What you said about bmp and the PE format makes no sense because they are BOTH formats that were invented for Windows.

Let me say this another way. PE Format has a specification that defines it, right? If you follow the specification you can implement it for any program, whether that program (loader) works on Linux, Mac or Windows.

I don't think you understand one bit how the OS is structured, you talk as if it's only one entity instead of a collection of programs. Is paint.exe part of the OS? What about the loader? These things can be implemented under a normal Linux program (Wine), so they surely aren't part of the Microsoft OS are they?

PE format, like bmp, has a specification. If you follow the specification when you make a program that READS THIS FORMAT, such as a LOADER or a PAINT PROGRAM, you make the target machine (whatever that is) able to read it.

Why is PE so different for you than bmp, gif, jpg or others? The specification is open too.

Azu wrote:
I'm pretty sure that Windows counts as a "particular operating system", sorry.
???
People use Windows.
--> People have the loader code and they can't do anything about it.

So why not just USE it, since it's already on their machines?

Azu wrote:
Tomato tohmatoh.
Sorry but that is where Wine comes from (recursive acronym). Surely Azu must know better than the dev who originally thought of the idea and even implemented the thing Rolling Eyes

Wine is to PE what paint.exe is to bmp.

Here's another thing. Suppose there's a program that has its own format. This program only runs under Linux. Does that mean that the FORMAT is LINUX SPECIFIC?

WTF don't you see the problem with that wording?
It's the LACK of a PROGRAM to READ that FORMAT under WINDOWS that's the problem here, NOT THE FORMAT.

Azu wrote:
It's a GUI-less implementation of Windows.
No wonder you can't grasp the above simple concept...

Azu wrote:
What are you even trying to say here?
PE is the internal executable format of the Windows operating system.
"internal" what do you mean?

The correct phrase would be:

PE is a executable container. It is implemented in the Windows loader, even though the specification is open, so anyone can implement a loader if they wish.

Of course Wine does much more than just a loader -- it also is a translation layer for the Windows API -- but that has nothing to do with the PE format or its specification.

_________________
Previously known as The_Grey_Beast
Post 18 Nov 2009, 15:35
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
You know Azu, I'm gonna invent a new executable container myself.

The loader won't exist yet -- I'll leave the specification to people to make loaders for it.

Is it part of an OS?
Post 18 Nov 2009, 15:38
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1160
Azu
Okay, I see where your confusion stems from now. Somebody moved this to Heap.

You think it was original posted under the "Windows" forum, but actually it was in the "Main" forum which clearly states
Quote:
General discussion about flat assembler, not related to any particular operating system.



Hopefully that clears things up for you.

_________________
Post 18 Nov 2009, 23:45
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.