Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: JPEG options

52 views
Skip to first unread message

Paul Edwards

unread,
Dec 31, 2023, 11:15:15 PM12/31/23
to
Can't reply via google groups anymore.
Here's the original thread:

https://groups.google.com/g/alt.os.development/c/MCLGU068vS0/m/UzTcYv2dBAAJ


On Saturday, May 15, 2021 at 11:43:29 PM UTC+8, Herbert Kleebauer wrote:
> On 15.05.2021 05:56, muta...@gmail.com wrote:
>
> > The three operations:
> >
> > 1. Interpreting a JPEG file format.
> > 2. Finding the correct Windows API to call.
> > 3. Putting the appropriate colors in place
> >
> > are not trivial to me, and I am grateful that you
> > have provided code to do this.

> You are right, these three steps are not trivial. You have
> to read a lot of documentation and the main purpose of the
> code was, to make sure, that I did understand the documentation
> correctly. But the code itself is just a trivial implementation
> of the specification.

Hi Herbert.

Your code has been put into the PDOS tree
and then (a degree of) Windows graphics
support was added to PDOS/386 to support
this code.

So THIS became the reference. So now on PDOS/386
you can build a graphics executable that works
on both PDOS/386 and Windows (I use Windows 2000).

pdos.zip at http://pdos.org

BFN. Paul.

Herbert Kleebauer

unread,
Jan 5, 2024, 3:56:06 AMJan 5
to
On 01.01.2024 05:15, Paul Edwards wrote:

> So THIS became the reference. So now on PDOS/386
> you can build a graphics executable that works
> on both PDOS/386 and Windows (I use Windows 2000).
>
> pdos.zip at http://pdos.org

May I ask, why you spend so much time to create
a PD operating system? PD is great for trivial
programs or a quick and dirty hack to show some
principles (like the jpeg decoder), but for bigger,
useful software (like an OS), GPL is much superior.
Everybody has the freedom to enslave PD software,
but GPL software is free for ever, nobody can
enslave it. So, PD software is the extreme opposite
of free software.



Dan Cross

unread,
Jan 5, 2024, 8:19:37 AMJan 5
to
In article <un8g73$3ljd$1...@dont-email.me>,
PLEASE don't feed the troll.

- Dan C.

Paul Edwards

unread,
Jan 7, 2024, 5:31:28 AMJan 7
to
I have a very different philosophy to that,
which can be found here:

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpgoal.txt

And I encourage you to go forth and "enslave"
PDOS/386 - whatever that even means. And good
luck with that.

BFN. Paul.

Paul Edwards

unread,
Jan 7, 2024, 5:37:21 AMJan 7
to
On 05/01/24 16:56, Herbert Kleebauer wrote:

> principles (like the jpeg decoder), but for bigger,

BTW, do you have this "dos.c" file available?

D:\devel\pdos\pfp\source>grep dos.c pfp.c
pfp.c: /*unsigned char bgr[3*HBMP*VBMP]; declared in dos.c or win.c */
pfp.c: /*#include "dos.c"*/ /* DOS version */

D:\devel\pdos\pfp\source>


Thanks. Paul.

Herbert Kleebauer

unread,
Jan 7, 2024, 10:15:46 AMJan 7
to
On 07.01.2024 11:31, Paul Edwards wrote:

> I have a very different philosophy to that,
> which can be found here:
>
> https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpgoal.txt

This text is a sequence of arguments why GPL is much
superior to PD. Just a few examples:

|| The Public Domain Project's philosophy is basically to put as much
|| base material into the public domain so that commercial developers,
|| or other PD developers, can build upon it, rather than having to
|| reinvent the wheel.

That's also true if you replace "PD" by "GPL".


|| It's like inventing the cure for cancer and keeping it a
|| secret. You may as well not have bothered.

Let's suppose, a group of scientists have developed such a
medicine, spending many man-years of development and then
releases it into PD. There are still some serious undesirable
effects, so it can't be used as it is. A company analyses the
research results and finds an improvement which removes the
undesirable effects so it now is the medicine, the whole world
is waiting for a long time. But the company isn't stupid, they
claim a patent for the modification, so nobody is allowed to
produce the medicine, even nearly all the work is released to PD.
And because the company isn't stupid, they sell it not for a
fair price for the little work they did, but they sell it for
the highest price they can get. So now we have the medicine, the
whole world is waiting for a long time, but only a few rich counties
are able to pay for it. That wouldn't have happened if a "GPL" instead
a "PD" would have been used.


I will not comment more of your text, but every sentence in
the text explains way GPL has to be preferred over PD.

Du you really think, Linux would still exist if it were
released in PD? Most contributions to Linux are now made
by companies. Why do you think Google uses Linux for
Android and doesn't develop its own, closed source, kernel?

Herbert Kleebauer

unread,
Jan 7, 2024, 10:31:58 AMJan 7
to
I used the DOS version only for the first test versions.
And the code depends on the graphics card used.

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
dos.c
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

/*
#define TIME 0
*/

#include <stdlib.h>
#define SEEK_SET 0
/**************************************************************************/

unsigned char bgr[3*HBMP*VBMP];
int xpos=0,ypos=0,HWIN,VWIN;

/**************************************************************************/
void crypt(unsigned char*,unsigned int*);
void get_passwd();
int getC();
void init();
void setpict(int);
int decode();
void cleanup();
void ende(int,int);
int get_byte();
int get_word();
void SOI();
void EOI();
void DQT();
void DHT();
void SOF();
void SOS();
void APP0();
void COM();
void UNKNOWN();
void out_string(char*);
void out_byte(int);
void out_bin(int,int);
void out_hex1(int);
void out_hex2(int);
void out_hex4(int);
void out_dec(int);
void print_string(char*);
void print_dec(int);
int get_bits(int);
void zeichne();
void scale1();
void scale2();
void scale3();
void scale4();
void (*scale)() = scale3;
/* 1: no scale 2: fast 3: slower but better 4: best */

/**************************************************************************/


main(nargs,args) int nargs; char *args[];
{int i,dir=0;
char *p,*q;
unsigned long t1,t2,t3;

if (nargs!=2) p="test.jpg";
else p=args[1];
q=filename;
while (*p == ' ') p++; if (*p=='"') p++; i=0;
while ( (*q++ = *p++)>' ' && (i++ < 1024) );
*(--q)=0; if (*(--q)=='"')*q=0;

init();
init_vga(); HWIN=800; VWIN=600;

#ifdef TIME
t1=clock();
#endif
decode(); scale(); zeichne();

loop:

#ifndef TIME
i=0xff&get_key();
#else
i=' ';
#endif

if (i == ' ')
{if (dir<=0) {setpict(pictnr-dir); dir=1; decode(); scale();}
zeichne();
if (decode())
{dir=0;
#ifdef TIME
t2=clock();
cleanup();
reset_vga();
i=t2-t1; printf("\nZeit 1:%d\n",i);
get_key();
exit(0);
#endif
}
scale();
}
else if (i == 'b'|| i == 'B')
{if (dir>=0) {setpict(pictnr-2-dir); dir= -1; decode(); scale();}
zeichne();
if (pictnr==1) dir=0; else {setpict(pictnr-2); decode(); scale();}
}
else if (i == 'x' || i == 'X')
{cleanup(); reset_vga(); exit(0);}
goto loop;
}


/**************************************************************************/

void get_passwd()
{int i,j,k;
goto gk1;
gk0:
printf("\npassword to short\n");
gk1:
printf("Enter password:");
printf("\n------------------------\n");
for (i=0; i<24; i++) if ((passwd[i]=getc(stdin))=='\n') goto gk0;
while (getc(stdin)!='\n');
passwd[25]=0;
}

void zeichne() {disp_rgb(bgr);}


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
gra.s
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
.text
.globl _init_vga
.globl _reset_vga
.globl _disp_rgb
.globl _get_key
.globl _tst_key

_get_key:
xorl %eax,%eax
int $0x16
ret

_tst_key:
xorl %eax,%eax
incb %ah
int $0x16
jnz L_t1
xorl %eax,%eax
decl %eax
L_t1: ret


_init_vga:
pushl %ebx
movw $0x4f02,%ax
movw $0x0114,%bx # 800x600 64k
int $0x10
xorl %eax,%eax
popl %ebx
ret

_reset_vga:
movw $0x03,%ax
int $0x10
xorl %eax,%eax
ret

_disp_rgb:
pushl %ebx
pushl %ecx
pushl %edx
pushl %esi
pushl %edi

movl 4+20(%esp),%esi
movl $800,Ldr100

movw $0,%edx
Ldr20: movl $0x8000,%ecx
Ldr30: movw $0x4f05,%ax
xorl %ebx,%ebx
int $0x10

movl $0,%edi
Ldr10: xorl %eax,%eax
movb 2(%esi),%al
shll $5,%eax
movb 1(%esi),%al
shll $6,%eax
movb (%esi),%al
shrl $3,%eax
movw %ax,0xe00a0000(%edi)
addl $3,%esi
addl $2,%edi
decl Ldr100
jne Ldr11
movl $800,Ldr100
addl $(1024*2-800)*3,%esi
Ldr11: decl %ecx
jne Ldr10

addw $1,%dx /* abhaengig von Graphikkarte */
cmpw $1*14,%dx /* Abfrage durch int 10h ax=4f01 */
/* 16 fuer 4 kByte Granualitaet */
/* 1 fuer 64 kByte Granualitaet usw. */
jc Ldr20
movl $21248,%ecx
je Ldr30

popl %edi
popl %esi
popl %edx
popl %ecx
popl %ebx
xorl %eax,%eax
ret
Ldr100: .long 0







BGB

unread,
Jan 7, 2024, 3:01:31 PMJan 7
to
My preference at this point is more for the MIT or BSD style licenses.
Personally, at this point, I am using the MIT license for most of my own
code.

These allow many of the same freedoms, but with fewer potential issues
from a legal POV (and generally CC0 isn't really considered a valid
license for software; though MIT-0 and BSD-0 are generally considered as
acceptable and do "basically the same thing").

I guess the major practical difference between the normal MIT (Expat)
and MIT-0, is that MIT license requires keeping the notice intact in
copies of significant chunks of the code, whereas MIT-0 does not (so
effectively also allows code to be freely moved to other licenses).


GPL has the drawback that with plain GPL, anything that uses GPL code
also needs to be made GPL. Only way around this is to add a linking
exception or use LGPL instead.

At one point, I was mostly using LGPL but then went over to MIT.


I guess the usual argument for GPL is that GPL would hinder people using
the code in otherwise closed commercial products, but, this limitation
hasn't really stopped companies like Linksys and Google and similar from
doing so.

...


> BFN. Paul.
>

Paul Edwards

unread,
Jan 7, 2024, 4:36:54 PMJan 7
to
On 07/01/24 23:15, Herbert Kleebauer wrote:
> On 07.01.2024 11:31, Paul Edwards wrote:
>
> > I have a very different philosophy to that,
> > which can be found here:
> >
> > https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpgoal.txt
>
> This text is a sequence of arguments why GPL is much
> superior to PD. Just a few examples:

As I said - I have a different opinion,
and that remains the case.

> || The Public Domain Project's philosophy is basically to put as much
> || base material into the public domain so that commercial developers,
> || or other PD developers, can build upon it, rather than having to
> || reinvent the wheel.
>
> That's also true if you replace "PD" by "GPL".

I disagree. I am absolutely reinventing all the
software I use, because I only have a GPL version,
and I want a PD version.

The reverse is probably not true - the GPL people
are probably happy to pick up public domain code
because it doesn't interfere with their diabolical
license.

> || It's like inventing the cure for cancer and keeping it a
> || secret. You may as well not have bothered.
>
> Let's suppose, a group of scientists have developed such a
> medicine, spending many man-years of development and then
> releases it into PD. There are still some serious undesirable
> effects, so it can't be used as it is. A company analyses the
> research results and finds an improvement which removes the
> undesirable effects so it now is the medicine, the whole world
> is waiting for a long time. But the company isn't stupid, they
> claim a patent for the modification, so nobody is allowed to
> produce the medicine, even nearly all the work is released to PD.
> And because the company isn't stupid, they sell it not for a
> fair price for the little work they did, but they sell it for
> the highest price they can get. So now we have the medicine, the
> whole world is waiting for a long time, but only a few rich counties
> are able to pay for it. That wouldn't have happened if a "GPL" instead
> a "PD" would have been used.

Ok, I understand your argument.

You don't like the idea of "greedy companies"
making obscene profits while the 3rd world
dies of terrible deaths.

I won't comment on whether I agree or not with
that sentiment, but if you wish to change that,
I would attack it at the political level, and
install a communist government or whatever it is
you think is better than what we already have.

Rather than attempting your anti-capitalist
revolution via - software licensing.

Note that the capitalist governments merely need
to amend copyright law to say that freeware may
not be copyrighted, to put an end to your
"revolution".

> I will not comment more of your text, but every sentence in
> the text explains way GPL has to be preferred over PD.

I have a very different opinion.

> Du you really think, Linux would still exist if it were
> released in PD?

Yep.

> Most contributions to Linux are now made
> by companies.

And it's a tragedy that those companies aren't
working on a public domain product instead.

Perhaps because a public domain product didn't
exist at the time. It does now, belatedly.

> Why do you think Google uses Linux for
> Android and doesn't develop its own, closed source, kernel?

Because the market is now skewed.

Regardless, how is the "enslaving of PDOS"
going so far?

Made some of those obscene profits you alluded to?

What did you do with all that money?

Are you sure your theory isn't fundamentally flawed?

BFN. Paul.

0 new messages