Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract kernel32.slb? #2

Open
vinriviere opened this issue Jul 17, 2018 · 8 comments
Open

Extract kernel32.slb? #2

vinriviere opened this issue Jul 17, 2018 · 8 comments

Comments

@vinriviere
Copy link
Member

What about extracting kernel32.slb to its own repository?
That would make sense, now.

@th-otto
Copy link
Contributor

th-otto commented Jul 17, 2018

Dunno whether that's worth it. I think it was rather more a proof-of-concept rather than a useful library. Not even gemma now actually needs it.

@mikrosk
Copy link
Member

mikrosk commented Jul 17, 2018

I feel the same, it's perhaps waste of time and resources. Btw Thorsten I had the feeling that you have reimplemented kernel32.slb for gemma? So how come gemma doesn't need it?

@th-otto
Copy link
Contributor

th-otto commented Jul 17, 2018

Yes, i did that initially to get a working version of gemma. When i was finished and realized that most of the functions in the slb are just wrappers for gemdos calls, i introduced the _USE_KERNEL32 define. gemma now just uses the bindings from mintbind.h most of the time, only a few functions that are more than just wrappers are reimplement in dosproto.c.

@mikrosk
Copy link
Member

mikrosk commented Jul 17, 2018

I see. So the kernel sources are still there and usable? I ask for the hypothetical possibility that somebody at some point realises he likes that idea of a shared GEM library (to be honest I don't know what was supposed to be the killer feature of gemma -- shared gemlib in the end?) and would like to use/extend it - with gemma's test apps as a proof of concept.

@th-otto
Copy link
Contributor

th-otto commented Jul 17, 2018

I see. So the kernel sources are still there and usable?

In theory, yes. There is but one quirk with it. As already noted elsewhere, it currently does not come with a static library, because the interface is in inline functions. That is however only true for functions that are actually used by gemma. To make it really usable, you would have to define also inline functions for all the other functions. Or create a static library for it, too, some of the wrappers are already in src/dosproto.c.

to be honest I don't know what was supposed to be the killer feature of gemma

It contains some useful functions that are often needed in gem applications, maybe somewhat similar to cflib, just implemented as a shared lib. There is also some documentation for it available.

@vinriviere
Copy link
Member Author

Not even gemma now actually needs it.

Really? When trying to run gemma's test program, I had to put kernel32.slb into c:\mint\slb, otherwise it didn't run. Maybe I did something wrong?

to be honest I don't know what was supposed to be the killer feature of gemma

When looking at test.app, is is really small (about 2 KB, IIRC), for a full-featured GEM program. IMHO that's the killer feature of gemma. Or maybe it is only due to the custom startup code.

Anyway: if kernel32 is really useless for gemma, it should be either completely removed, or moved to its own repository. Having duplicated, unused code is never good.

@th-otto
Copy link
Contributor

th-otto commented Jul 17, 2018

Maybe I did something wrong?

Maybe some gemma32.slb loaded from somewhere else? I just tried again:

$ ls -l c:/mint/slb
total 100
-rw-r--r-- 1 sebilla users 53683 Mar  1  2012 dracdlg.slb
-rwxr-xr-x 1 sebilla users 41457 Jul 14 02:26 gemma32.slb
$ ./test.app

works here. Well, almost. Just noticed that is it apparently does not exit.

Or maybe it is only due to the custom startup code.

Not only, but without that, it would pull in large parts of mintlib, like all other programs do. But that also means you can't use functions like open() because they are not properly initialized, you don't have support for ARGV in your commandline etc.

@th-otto
Copy link
Contributor

th-otto commented Jul 18, 2018

The test app was a bit dumb, you could only quit it by pressing Ctrl-Q. I've changed that now so it exits when all windows are closed.

Also fixed a crash in configtool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants