News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

API Source

Started by Renfield, October 21, 2008, 07:08:13 PM

Previous topic - Next topic

Renfield

Is there source available for Windows API?  If one was particularly obsessive could they program their own graphics utilities?  What would it take?  How does it work?  I am particularly obsessive and the notion of MASM is pulling me in.  Though, if I have to use other people's code, I might as well stick to higher-level languages.

Vortex

Hello Renfield,

Welcome to the Masm Forum.

QuoteIs there source available for Windows API?

All Windows versions are closed source code so I am afraid you cannot find references to API source code.

Xacker

welcome,

Quote from: Renfield on October 21, 2008, 07:08:13 PM
Is there source available for Windows API?
answered by Vortex.

Quote
If one was particularly obsessive could they program their own graphics utilities?
sure, why not. But are you sure you mean "utilities" rather than "engines".

QuoteWhat would it take?
patience,knowledge,obsession :)

Quote
How does it work?
ouch.. if you are really into the graphics stuff, I don't think assembly is the easiest way to do it.

Quote
Though, if I have to use other people's code, I might as well stick to higher-level languages.
you will always at some point use other people's code. How do you think you can operate inside the system?
unless you are to create a ring0 application, which is something else.

BogdanOntanu

Quote
you will always at some point use other people's code. How do you think you can operate inside the system?

Not necessarily ;)

For example: I have my own OS with my own API (Solar_OS) and my own assembler / compiler (Sol_Asm) and of course my own huge game (Hostile Encounter) with AI, game engine and real-time raytracer engine and many other smaller tools ... all written in assembly by me and some friends (approx 1/2 from HE is done by Eugen; Hawk and Eugen helped with OS also) and I use nobody else's code  and have no dependency.

So yes it is possible. It takes a lot of understanding, patience and dedication... obsession is irrelevant... knowledge is also irrelevant.

However on an well established OS like Windows it is better to use the API even in ASM because it gives you independence from the hardware. You can implement all other parts in ASM and sometimes you can even skip many non hardware related API (wsprintf for example).

ASM is just a programming language... some prefer ASM some prefer HLL. On this forums we do prefer ASM ;)



Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Xacker

Quote from: BogdanOntanu on October 21, 2008, 08:58:37 PM
Quote
you will always at some point use other people's code. How do you think you can operate inside the system?

Not necessarily ;)

For example: I have my own OS with my own API (Solar_OS) and my own assembler / compiler (Sol_Asm) and of course my own huge game (Hostile Encounter) with AI, game engine and real-time raytracer engine and many other smaller tools ... all written in assembly by me and some friends (approx 1/2 from HE is done by Eugen; Hawk and Eugen helped with OS also) and I use nobody else's code  and have no dependency.

So yes it is possible. It takes a lot of understanding, patience and dedication... obsession is irrelevant... knowledge is also irrelevant.

However on an well established OS like Windows it is better to use the API even in ASM because it gives you independence from the hardware. You can implement all other parts in ASM and sometimes you can even skip many non hardware related API (wsprintf for example).

ASM is just a programming language... some prefer ASM some prefer HLL. On this forums we do prefer ASM ;)

Everything changes when you do it from the scratch that is a fact for sure, but would I write my own OS just not to use people's code when I create my application?

It is "my OS", so I'm pretty sure no one else is using it, and if they did, it has to compete with the other most-used OS out there.

anyway, I respect your dedication and hard work. Hat off for you.

BogdanOntanu

Quote
Everything changes when you do it from the scratch that is a fact for sure, but would I write my own OS just not to use people's code when I create my application?

That is not the "point". I have many years as a professional programmer on Windows, Unix and embedded systems writing applications on all sorts of architectures and programming languages and interfacing with all levels of library and "alien" code.

The "point" is to gain understanding. And you never understand for real unless you create things from scratch.

After writing my OS I have a much deeper understanding of hardware and drivers interactions and GUI and applications. A greater experience and understanding than I have obtained in 20+ years of low level and high level programming. After doing my compiler I understand more about the CPU and compilation process and object formats. After doing my own debugger and decompiler again I gained valuable understandings, after doing my own GAME engine I understood more than I ever would about AI and GFX and raytracing and... the list is endless.

Since I already did  my own computer from soldered integrated circuits when I was young ...
... I will start designing and making my own CPU soon.

Quote
It is "my OS", so I'm pretty sure no one else is using it, and if they did, it has to compete with the other most-used OS out there.

OS is not yet finished yet so it is unlikely to be used by other people unless it is for testing or learning by example. And BTW there are other full ASM OS or small hobby OS and some are more advanced or close to SOLAR OS. IMHO the ideal situation would be that everybody is using his own OS and we interconnect via clear and open standards.

But one other "point" besides understanding and creation  is obtaining independence from others including Windows and Unix/Linux and embedded RTOS or emerging Google worlds.  Competition is irrelevant for this issue.  Anyway since I have something at least semi functional then I could "compete" if I ever wanted... as a "user" you can only compete at application level ;)

Quote
anyway, I respect your dedication and hard work. Hat off for you.
Thank you for your kind words... but "respect" is irrelevant and so are "The hats" ;)

To answer the OP:
===============
API source is of course "irrelevant". You can create your own API inside a game using DirectX for example like we did in Hostile Encounter because you would need to reinvent a lot of "wheels" anyway. Once you gain this creation experience you will not care much for "source of others" and you can move into more "deeper" creations ;)

But you must start somewhere to establish a base and expand you knowledge and Windows and API and MASM32 is a good place to start...

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

jdoe


BogdanOntanu,

Your point is very clear but I have a question for you about Windows OS. After all you've done for understanding what's going on under the hood, what you think now about the Bill Gate Windows design ? What are the strong part and the weak parts of Windows based on your point of view. It is not that I myself understand all about this but an opinion is always welcome for me to read. For example, does the way Windows messages work makes sense for you. For me it does but I would like some word about it from you.

regards

jdoe


Xacker

@BogdanOntanu:

I know if I continue to argue with you about a "point" then it will take us to nowhere but arguments and flaming.

I'm gonna respect the board rules and try not to get into that, I know I can, because simply I can't stand arro... oh forget it.

BogdanOntanu

jdoe:
====
yes it does. IMO Windows GUI API is in the same position as MASM: the best solution available at the moment when compared with alternatives. . However it is perfectible in many ways but I will not get into details here because I do not think this was the OP question.

Windows GUI API was not Ms or Bill Gates design. It was "stolen" from Apple that was "stolen" from Xerox that din not "see" a use for it. At times this Windows->Apple->Xerox legacy is visible. Again the NT core is not their design. It is VMS with a "new look"and this also shows between the lines. The older DOS or Win9x cores are a kind of CP/M with a new look.

Anyway, from my experience  I fell that Windows API  is the best that we have today mainly when compared with the Unix / Linux alternatives. Of course in my OS I do try to improve this and walk a road not taken because otherwise Windows is the Highway.

This might slowly change in the future because lately I notice windows core and API/GUI making mistake after mistake presumably because the new people getting inside are less and less intelligent and have less experience with building things from scratch... and this also shows.



Xacker:
======
Again for things that are not MASM related and more Sol related you are wellcome to flame my forums with "points"... at times I do answer or participate in such debates for fun or for teaching purposes.

Also this MASM32 forum has a section named Colosseum here: http://www.masm32.com/board/index.php?board=6.0
that is designed for such matters and under certain limits debates are allowed in there.

Again I do not think the OP intended such a debate on his topic ;)
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Grincheux

Why do you don't take a look at "Wine"

http://www.winehq.org/

It's just an idea !
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

asmfan

There is study sake MS program - WRK aka Windows Research Kernel. It contains source code for some (quite a lot) windows kernel (native api) functions /the list is big enough to dig in it/ of Win2003.
Russia is a weird place

Renfield

Is it possible to develop a graphics-based application to run under Windows that does not use the Windows API?

BogdanOntanu

Quote from: Renfield on October 22, 2008, 07:05:45 PM
Is it possible to develop a graphics-based application to run under Windows that does not use the Windows API?

No. And you can not do this under any OS. This is the whole idea of an OS: you must use it's API. Each OS has it's own API and you should get used with it. However to what extent you use the API is another question.

For example you could use DirectX in order to obtain a pointer to video memory buffer (primary surface) and then draw all your own GFX in this kind of "linear framebuffer"  "as if" windows does not exist.

Many modern applications do this (firefox for example) just in order to have a look and GUI that is OS independent. However this is a lot of work because you must re invent the edit box, the button, the check box, the tree view, etc etc. Even Windows teams admit to do this sometimes! But you still use API to setup a window and to setup DirectX.

However I do not understand your concern about "not using API". You should explain better what you intend to do or otherwise we are giving general non exact answers here and this might be missguideing.

API is there to help you start. IF your application is only calling API then it does not have a big value. Anybody can do that in any programming language. The value starts to add when you add your own code and algorithms that are NOT in the API...

Hence you should use the API to create a window and get user input... but draw in it using your own GFX algorithms ;)
In other words use the API to create a framework but fill in the frame with your own ideas and creativity.

DO not avoid the API.... API is your friend and it is there to help you start and it is not going to stop you from "running".

Without the API you would have to write a driver for each hardware device. the only time you do this is when you write an OS and this is relatively hard.

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

Renfield

Quote from: BogdanOntanu on October 22, 2008, 07:53:59 PM
However I do not understand your concern about "not using API". You should explain better what you intend to do or otherwise we are giving general non exact answers here and this might be missguideing.

You've given me the answer I was looking for; I only had to re-word my question.  This was very informative, thanks to you and everyone who replied.   :thumbu

BogdanOntanu

Quote from: Renfield on October 22, 2008, 08:20:01 PM
...
You've given me the answer I was looking for; I only had to re-word my question.  This was very informative, thanks to you and everyone who replied.   :thumbu

I really doubt it... but you are welcome. With unclear questions you get unclear answers.

Now let me tell you that I could also answer YES to the above question if I really wanted to  :green2 (and I would not be wrong)
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro