Re: elkscmd

1999-01-16 Thread Alistair Riddoch

Mario Frasca writes:
 
 Hi Al,
 I think this will be interesting for most people on the list...
 well, I've written this version of init.c and modified date.c.
 
 *** init.c does a decent job, according to me, allowing the elks
 administrator to write a /etc/inittab file, but it sometimes (quite
 regularly) corrupts utmp.  I fear that I'm using too much memory, so I'm
 rewriting it again (but I have much less time now, compared to the
 previous weeks), this time I only keep in memory the ID and pid of
 running children which need to be respawned.  I will not care about
 anything else.  Do we have anything to measure the memory we still have
 at disposition?  so I can check any possible memory leak and compare
 memory usage.  the problem with the utmp is not a direct issue to me, so
 I prefer focusing on memory usage first.

We don't have anything at the moment, but you can always stick a printk in
kernel space so it prints the ammount of memory used by init periodically.
By default programs pre-allocate at least 32K and all the memory they
require must come out of this. You can reduce this value at compile time.

 
 *** date.c allows you to *insert* the current date (only ISO format
 [yy]yy-M-d[Th[:m[:s]]] is understood).  there are three ways to do this:
 
 date date (date is given as parameter)
 date ?  (stop and ask for the current date)
 date ?? (checks current date, if before 1992, it asks for the current
 date)

Okay, these make sense.

 a date without century is interpreted as 1970-2069.

This is patented. It is not legal to use this algorithm to deal with y2k
issues. See this link for more info:
http://slashdot.org/articles/99/11/01/2047228.shtml   ;-)

 
 I included 'clock -s ; date ??' in my /etc/rc.d/rc.sysinit, specified
 in my /etc/inittab as
 si::sysinit:/etc/rc.d/rc.sysinit
 
 oh, yes:
 under elks 0.0.79 this gave some problems, since only *one* virtual
 console was spawned (I had to log in as root and give 'init current
 runlevel' to start them).  in 0.0.81 this has been solved.
 under 0.0.81, clock does not work any more on my PPC640: it reads
 rubbish from the CMOS clock and writes such rubbish that after that the
 computer thinks the CMOS clock is broken.  so I took 'clock -s' away
 from my system initialization.
 
 how do I contribute the two programs?  is 'just mail to the
 list' an option?
 

Mailing to the list is fine.

Al



Re: ELKS on the TANDY-HD1000?

1999-01-16 Thread Alistair Riddoch

William Price writes:
 
 I have a Tandy HD 1000 Laptop (in fact there are several still out here in
 the world; they operate and last great) and it runs on an 8086 proc.
 
 Is there any news yet on whether this particular 8086 is going to be
 troublesome? I beleive part of the OS may be in rom...I'll check into it and
 repost. I know Tandy's flavor of DOS was mandatory for *some* reason, but I
 haven't looked into it again since I first tried two years ago.

I doubt very much that it is impossible to get ELKS booting on this
machine. All we have to do is find out what the difference are, and allow
for them in the source. It may be necessary to write drivers for custom
hardware.

 
 
 I would dearly love to use an 8086 laptop running ELKS, If I can get as much
 use as I have out of DOS. I do mostly text reading/composing (in EDIT), and
 also use a program called ODYSSEY for terminal emulation and dialup to shell
 accounts. I'd like top someday use it to network to the larger linux machine
 I'm building out of a 486 right now ( My main box is a P2...It doesn't get
 linux untill I know what I'm doing).
 

It sounds as though the things you do are mostly within ELKSs capability.
There is no networking yet, but loads of enthusiasm for it.

Al



Re: Intro

1999-01-16 Thread Alistair Riddoch

Giles Russell writes:
 
 
 
 Alan Cox wrote:
 
   development environment with an embedded OS.  In order to do this I must
   add SLIP  PLIP to ELKS, I would like to get in contact with the
   relevant ppl to find out what is being done, and what needs to be done
   on the networking layer.
 
  We dont really have a networking layer. I don't that is in itself a problem
  since you can prove you send/receive frames correctly and the rest is someone
  elses problem. There are some ideas for the stack kicking around. One thing
  for sure. The stack will be a userspace app.
 
 
 Well, there will be one by May, or my final marks will be lower than I would like
 :)
 
 
   Also if anyone has any ideas on getting an EEPROM to boot on an old 8086
   laptop, I would be greatfull :)
 
  Develop using DOSemu on Linux. It saves that annoying reboot cycle, and you can
  use the DOSemu ioport logging to debug it ;)
 
 I use BOCHs at present to test ELKS development, + my linux boxes to develop on :)
 

I use pcemu frequently, but have found over time that frequent testing on a
real machine pays.

What do you mean by booting an EEPROM on an 8086 laptop? WE currently have
the capability to boot the kernel from an EPROM on an ISA card such as a
NIC, or somehting similar.

Al



Re: elkscmd

1999-01-16 Thread Jakov af Wallby

On Thu, 18 Nov 1999, Alistair Riddoch wrote:

 Mario Frasca writes:

  a date without century is interpreted as 1970-2069.
 
 This is patented. It is not legal to use this algorithm to deal with y2k
 issues. See this link for more info:
 http://slashdot.org/articles/99/11/01/2047228.shtml   ;-)

Software patents don't make sense.
This patent is extremely ridiculous.
Where do you live Mario? Citizen where?
That is probably patented only in the US.
Not all states do allow software patents.

(Sweden doesn't allow software patents. Software can only be patented
in Sweden as a part of a physical mechanism or machine, not by itself.
That algorithm can be used by others for any other purpose, as long as
it is not in the machine or mechanism you have patented.)

Jakob




Re: elkscmd

1999-01-16 Thread Alistair Riddoch

Jakov af Wallby writes:
 
 On Thu, 18 Nov 1999, Alistair Riddoch wrote:
 
  Mario Frasca writes:
 
   a date without century is interpreted as 1970-2069.
  
  This is patented. It is not legal to use this algorithm to deal with y2k
  issues. See this link for more info:
  http://slashdot.org/articles/99/11/01/2047228.shtml   ;-)
 
 Software patents don't make sense.
 This patent is extremely ridiculous.
 Where do you live Mario? Citizen where?
 That is probably patented only in the US.
 Not all states do allow software patents.
 

I only pointed this out in humor. I don't advocate complying with stupid
patents like this, and they don't apply in the UK (yet) anyway.

Al



Re: The kiss NETWORKING

1999-01-16 Thread Vali Dragnuta

 
 What about me!!! I was one of the first to reply, I am very interested in 
 coding and testing.
 
 I also have exams, what are you doing and where are you vali?
 
 tom
TOM, I  am a student at the Academy of Economic Studies, in Bucharest, Romania.
My faculty is 'Cybernetics, Informatics and Statistics applied in Economics'
(The 'Econimic' part of this stuff lets me  cold  like an Iceberg.All I'm
interested in are the computer science disciplines)



 
 __
 Get Your Private, Free Email at http://www.hotmail.com



date

1999-01-16 Thread Mario Frasca

so, here comes `date'.  I'll post `init.c' when I find it back.

I hope I won't have too much trouble with algorithms owners.  hey! we
can't reinvent the wheel each time any more, we have to buy it!
ciao,
Mario.

/*
 * date  small utility to check and set system time.
 *
 * Usage: /bin/date
 *   date [?[?]] | date
 *
 * 1999-11-07  [EMAIL PROTECTED]
 *
 *  Copyright 1999 Mario Frasca
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version
 *  2 of the License, or (at your option) any later version.
 *
 */

#include time.h
#include sys/time.h

/* EarlyDate is 1992-01-01T00:00:00 */
#define EARLYDATE 694288800L

/* our own happy mktime() replacement, with the following drawbacks: */
/*doesn't check boundary conditions */
/*doesn't set wday or yday */
/*doesn't return the local time */
time_t utc_mktime(t)
struct tm *t;
{
 static int moffset[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273,
304, 304 };
 time_t ret;

  /* calculate days from years */
 ret = t-tm_year - 1970;
 ret *= 365L;

  /* count leap days in preceding years */
 ret += ((t-tm_year -1969)  2);

  /* calculate days from months */
 ret += moffset[t-tm_mon];

  /* add in this year's leap day, if any */
   if (((t-tm_year  3) == 0)  (t-tm_mon  1)) {
  ret ++;
   }

  /* add in days in this month */
   ret += (t-tm_mday - 1);

  /* convert to hours */
 ret *= 24L;
   ret += t-tm_hour;

  /* convert to minutes */
   ret *= 60L;
   ret += t-tm_min;

  /* convert to seconds */
   ret *= 60L;
   ret += t-tm_sec;

  /* return the result */
   return ret;
}

void usage()
{
 fputs("date: read or modify current system date\n", stdout);
 fputs("usage: date ?[?]|[yy]yy-m-dTh:m:s\n", stdout);
 exit(1);
}

int main(argc, argv)
char ** argv;
int argc;
{
 time_t systime;
 time(systime);

 if(argc==1)
 {
  fputs(ctime(systime), stdout);
 }
 else if (argc2) usage();
 else
 {
  char *p, buf[32];
  struct tm tm;
  struct timeval tv;

  if(argv[1][0] == '?')
  {
   if((argv[1][1] == '?')  (systime  EARLYDATE))
return 0;

   /* ask user for current date */
   fputs("insert current date: ", stdout);
   fgets(buf, 31, stdin);
   p = strtok(buf,"-");
  }
  else
   p = strtok(argv[1],"-");

  tm.tm_year= tm.tm_mon= tm.tm_mday= tm.tm_hour= tm.tm_min= tm.tm_sec=0;

  do{
   tm.tm_year = atoi(p);
   if(!(p = strtok(NULL, "-"))) usage();
   tm.tm_mon = atoi(p);tm.tm_mon--;
   if(!(p = strtok(NULL, "T"))) usage();
   tm.tm_mday = atoi(p);
   p = strtok(NULL, ":");
   if(!p) break;
   tm.tm_hour = atoi(p);
   p = strtok(NULL, ":");
   if(!p) break;
   tm.tm_min = atoi(p);
   p = strtok(NULL, "\n");
   if(!p) break;
   tm.tm_sec = atoi(p);
  }while(0); /* only to have that 'break' */
  if(tm.tm_year70) tm.tm_year+=2000;
  else if(tm.tm_year100)tm.tm_year+=1900;
  else if(tm.tm_year1970)
   usage();
  systime = utc_mktime(tm);
  tv.tv_sec = systime;
  tv.tv_usec = 0;
  if (settimeofday (tv, NULL) != 0)
  {
   fprintf (stderr,
"Unable to set time -- probably you are not root\n");
   exit (1);
  }

 }

   return 0;
}




RE: date

1999-01-16 Thread Greg Haerr

*
:  * Usage: /bin/date
:  *   date [?[?]] | date

One small point:  Isn't '?' a shell wildcard character?  This means that if wildcards
are enabled on the shell (currently not with ELKS, but should be) then the
? will have to be escaped?  Perhaps we should use a more standard option
scheme, with dashes.

Greg



and this is init(prototype)

1999-01-16 Thread Mario Frasca

/*
 * init  A System-V init Clone.
 * prototype version - already working on other concept!
 *
 * Usage: /bin/init
 *   init [0123456]
 *
 * 1999-11-07  [EMAIL PROTECTED]
 *
 *  Copyright 1999 Mario Frasca
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version
 *  2 of the License, or (at your option) any later version.
 *
 */

#include sys/types.h
#include stdio.h
#include unistd.h
#include utmp.h
#include fcntl.h
#include string.h
#include signal.h
#include assert.h
#include memory.h

#if 0
#define _(A) A
#else
#define _(A) ()
#endif

#define FLAG_RESPAWN   1
#define FLAG_WAIT  2
#define RUNLEVELS 12
#define BUFSIZE  256
#define INITTAB  "/etc/inittab"
#define INITLVL  "/etc/initlvl"
#define SHELL"/bin/sh"
#define GETTY"/bin/getty"
#define DEVTTY   "/dev/tty1"

#define RESPAWN  362
#define WAIT 122
#define ONCE  62
#define BOOT 147
#define BOOTWAIT 465
#define POWERFAIL403
#define POWERFAILNOW 951
#define POWERWAIT577
#define POWEROKWAIT  829
#define CTRLALTDEL   504
#define OFF   39
#define ONDEMAND 240
#define INITDEFAULT  707
#define SYSINIT  398
#define KBREQUEST622

/* `gently' exit */
#if 1
# define PANIC write(fileno(stderr), "init panic\n", 11),exit(1)
#else
# define PANIC exit(1)
#endif

/*
each of the entries from inittab corresponds to a child, each of which:
  has a unique 2 chars identifier.
  is allowed to run in some run-levels.
  might need to be waited for completion when spawned.
  might be running or not (pid different from zero).
  might have to been respawned.
  was respawned at a certain point in time.
*/
struct tabentry
{
 char id[2];
 char runlevels[RUNLEVELS];
 char flags;
 char *tospawn;
 int action;
 pid_t pid;
 time_t spawned;
 struct tabentry *next;
};

extern struct tabentry*
 tabentry_read_from_file _((struct tabentry* head, const char *
filename));

struct tabentry*
 tabentry_match _((struct tabentry* head, struct tabentry *entry));

void
 tabentry_insert _((struct tabentry** head, struct tabentry *entry));

void
 tabentry_update _((struct tabentry* match, struct tabentry *entry));

struct tabentry*
 tabentry_parseline _((const char* line));

void
 tabentry_clear _((struct tabentry* head));

void
 tabentry_stopif _((struct tabentry* head, const char runlevel));

void
 tabentry_startif _((struct tabentry* head, const char runlevel));

struct tabentry*
 tabentry_findpid _((struct tabentry* head, pid_t pid));

struct tabentry*
 tabentry_findaction _((struct tabentry* head, int action));

pid_t respawn _((const char *command));

struct tabentry*
 tabentry_read_from_file(phead, filename)
struct tabentry **phead;
const char * filename;
{
 int f, left;
 char buf[BUFSIZE], *line, *next;

#ifdef DEBUG
 printf("starting to read the file\n");fflush(stdout);
#endif

 f = open(INITTAB, O_RDONLY);
 if(-1 == f)
  PANIC;

 left = read(f, buf, BUFSIZE);
 line = strtok(buf, "\n");
 next = strtok(NULL, "\n");

 while (left)
 {
  if (!next)
  {
   if(line == buf)
PANIC;
   memmove(buf, line, left);
   left += read(f, buf+left, BUFSIZE-left);
   line = buf;
   next = strtok(buf, "\n");
 }
  else
  {
   struct tabentry *entry, *match;
   entry = tabentry_parseline(line);
   match = tabentry_match((*phead), entry);
   if(!match)
tabentry_insert(phead, entry);
   else
   {
tabentry_update(match, entry);
free(entry);
   }

   left -= next-line;
   line = next;
   next = strtok(NULL, "\n");
  }
 }
 close(f);
#ifdef DEBUG
 printf("done reading inittab\n");fflush(stdout);
#endif

}

struct tabentry*
 tabentry_match(head, entry)
struct tabentry* head;
struct tabentry *entry;
{
 struct tabentry* cur;
 char id0, id1;

 id0=entry-id[0];
 id1=entry-id[1];

 cur = head;
 while(cur  (cur-id[0] != id0 || cur-id[1] != id1))
  cur = cur-next;
 return cur;
}

void
 tabentry_insert(phead, entry)
struct tabentry** phead;
struct tabentry *entry;
{
 if(!(*phead))
  (*phead) = entry;
 else
 {
  struct tabentry *cur = (*phead);
  while(cur-next) cur=cur-next;
  cur-next = entry;
 }
 entry-next = NULL;
}

void
 tabentry_update(match, entry)
struct tabentry* match;
struct tabentry *entry;
{
 if(match-id[0] != entry-id[0] || match-id[1] != entry-id[1])
  PANIC;

 memcpy(match-runlevels, entry-runlevels, RUNLEVELS);
}

void
 tabentry_clearlist(cur)
struct tabentry* cur;
{
 while (cur)
 {
  memset(cur-runlevels, 0, RUNLEVELS);
  cur = cur-next;
 }
}

void
 tabentry_killif(cur, runlevel, sig)
struct tabentry* cur;
const char runlevel;
int sig;
{
 while (cur)
 {
  if(!strchr(cur-runlevels, runlevel)  cur-pid)
   kill(cur-pid, sig);

  cur = cur-next;
 }
}

void
 tabentry_stopif(head, runlevel)
struct tabentry* head;
const char runlevel;
{
/*
 * tabentry_killif(head, runlevel, SIGTERM);
 * do_sleep(1);
 */

 tabentry_killif(head, runlevel, SIGKILL);
}

void
 

Re: Intro

1999-01-16 Thread Giles Russell



David Murn wrote:
On Wed, 17 Nov 1999, Alan Cox wrote:
> We dont really have a networking layer. I don't that is in itself
a problem
> since you can prove you send/receive frames correctly and the rest
is someone
> elses problem.
Agreed. My ne[12]000 code (which should be in the CVS tree by
now),
should in theory let you send/receive frames. The fact that it
doesn't
properly work is a minor problem, however I'm suspecting only a tiny
bug.

OK, call me stupid, but how can I get to the CVS tree ???

> There are some ideas for the stack kicking around. One thing for
sure.
> The stack will be a userspace app.
I dunno about this. I think that a stack is fittable into kernel
space,
and this is how I intend to write the bits of it when I get ethernet
stuff
working.

Agreed, but for initial coding, it may be best to run in user space till
code fairly near to completion.
Who is Beau Kuiper, and is he still working on the networking stuff
???
Or is David working on it 
These may seem like simple questions, but I am getting the feeling the
docs are little out of date :)

DOSemu is great, but it has the problem that I can't talk to physical
hardware. For developing other code, such as tty code, or userspace
apps,
I gotta agree dosemu is great. I tried vmware too, but it seemed
a bit
excessive.


Have I mentioned BOCHs already ;)

G


Re: Intro

1999-01-16 Thread Luke (boo) Farrar




On Thu, 18 Nov 1999, Giles Russell wrote:

 
 
 David Murn wrote:
 
  On Wed, 17 Nov 1999, Alan Cox wrote:
 
   We dont really have a networking layer. I don't that is in itself a problem
   since you can prove you send/receive frames correctly and the rest is someone
   elses problem.
 
  Agreed.  My ne[12]000 code (which should be in the CVS tree by now),
  should in theory let you send/receive frames.  The fact that it doesn't
  properly work is a minor problem, however I'm suspecting only a tiny bug.
 
 
 OK, call me stupid, but how can I get to the CVS tree ???
 
 
   There are some ideas for the stack kicking around. One thing for sure.
   The stack will be a userspace app.
 
  I dunno about this.  I think that a stack is fittable into kernel space,
  and this is how I intend to write the bits of it when I get ethernet stuff
  working.
 
 
 Agreed, but for initial coding, it may be best to run in user space till code
 fairly near to completion.
 
 Who is Beau Kuiper, and is he still working on the networking stuff ???
 Or is David working on it 
 
 These may seem like simple questions, but I am getting the feeling the docs are
 little out of date :)

Beau Kuiper isn't doing the Networking stuff anymore.

I'd love to help, but right now I just don't have the time (I need to
work my ass off or I'll get kicked out of school). I had started
an ne2000 driver, but it apears that is is no longer required.

I don't know how to link the userspace stack to the kernel, but
I could help with the stack itself.

Luke(Boo) Farrar.



Re: The kiss NETWORKING, off subject!

1999-01-16 Thread Thomas Stewart

TOM, I  am a student at the Academy of Economic Studies, in Bucharest, 
Romania.
My faculty is 'Cybernetics, Informatics and Statistics applied in 
Economics'
(The 'Econimic' part of this stuff lets me  cold  like an Iceberg.All I'm
interested in are the computer science disciplines)

That sounds good, I am still in,(dont know what you call it where you are) 
secondary school/high school/sixth form. I am doing computer science next 
year in uni.

anyway, sorry for going completly off topic

tom

__
Get Your Private, Free Email at http://www.hotmail.com



Re: date

1999-01-16 Thread Ken Yap

:  * Usage: /bin/date
:  *   date [?[?]] | date

One small point:  Isn't '?' a shell wildcard character?  This means that if w
ildcards
are enabled on the shell (currently not with ELKS, but should be) then the
? will have to be escaped?  Perhaps we should use a more standard option
scheme, with dashes.

Greg

Yes probably -i for interactive input or -s for set or something like
that.



Re: Web browser ported to Microwindows

1999-01-16 Thread Andru Luvisi

On Sat, 13 Nov 1999, Greg Haerr wrote:
 I'm happy to announce that I've just heard that Opera Software has
 just ported their fully functional web browser to Microwindows!  
[snip]
 For more information on Opera Software, see www.opera.com.

I suppose this is good news.  Unfortunately, I don't seem to be able to
find the source for either the ported browser or the original on their web
site.  Could I trouble you for the url?

Andru
-- 
-- 
| Andru Luvisi | http://libweb.sonoma.edu/   |
| Programmer/Analyst   |   Library Resources Online  | 
| Ruben Salazar Library|-| 
| Sonoma State University  | http://www.belleprovence.com/   |
| [EMAIL PROTECTED]  |   Textile imports from Provence, France |
--



Re: [linuxce-devel] Re: Web browser ported to Microwindows

1999-01-16 Thread Alan Cox

 Yes, I suppose it would be good news also, if only their browser was GPL (or
 some other genuinely free  open-source license).  However, AFAICT it is
 thoroughly proprietary.
 
 Maybe they will choose to contribute back to Microwindows.  However, since
 Microwindows isn't GPL (it's MPL) they have no obligation to do so.

For a small browser the new gtkhtml work is looking very promising as a core.
Its actually the KDE khtmlw widget (that nice fast but not full of js/java/..
kfm viewer) aka 'konqueror' redone into C with a lot more gui independance.

Once its stable as a gtk widget it seems a good basis for an html viewer
for Nanogui/microwindows.



Re: [linuxce-devel] Re: Web browser ported to Microwindows

1999-01-16 Thread Richard Kvalsvik


For a small browser the new gtkhtml work is looking very promising as a core.
Its actually the KDE khtmlw widget (that nice fast but not full of js/java/..
kfm viewer) aka 'konqueror' redone into C with a lot more gui independance.

Once its stable as a gtk widget it seems a good basis for an html viewer
for Nanogui/microwindows.


I have heard a lot of things about konqueror, and much of it is not really 
good.
I really cant tell, I haven't seen anything of it. Is it as good as the 
developers
say it is ?



--
   Richard Kvalsvik

- Developer at Opera Software
- Lasershow designer for LASER-nordic



RE: [linuxce-devel] Re: Web browser ported to Microwindows

1999-01-16 Thread John Clark L. Naldoza

Heya,



I have heard a lot of things about konqueror, and much of it is not really
good.
I really cant tell, I haven't seen anything of it. Is it as good as the
developers
say it is ?



Can't really say because I have done any "standard" (if there is one) test.
But I had a chance to try out the KDE system with (what I assumed to be) the
KDE browser and  it "appeared" faster.  And the display was much better, in
my opinion, than that of Netscape.

But then again I haven't tried it out that much...  Too damn busy
programming these friggin' routers...;-)


Stay Cool,


J.C.