 |
SEAL The SEAL Forums
|
View previous topic :: View next topic |
Author |
Message |
BadSector Administrator

Joined: 24 Oct 2001 Posts: 328 Location: Greece, Samos
|
Posted: Sat Apr 24, 2004 10:53 am Post subject: XSeal Technology Test #1 |
|
|
Well, finally there is something to see.
XSeal Technology Test #1 is the result of my work from the day i became the maintainer until today (ok, actually until yesterday night :-P). I wasn't giving all my time here, so i suppose that if i did, the project could be made in, hm, less than a week. But i have a so-called real life and many more projects to deal with (which currently they have higher priority) so this is why it took so long.
The keyboard driver is still missing, but i've made a progress on it. I found some decent docs about how it works and i managed to read some keyb state bits. Unfortunatelly writing a keyboard driver needs a lot more work than i thought, since some keyboards behave differently than others. Anyway, i'll deal with it...
This Technology Test is not a prerelease, alpha, beta, preview or something. It's what its name says: a technology test. I'm releasing it in order to test the multitasking code that the XSeal will use. Try to run it in your computer and tell me the results.
There are NO graphics, NO sound, NO dynamic linking (libraries, executables), NO security and nothing usefull from a practical point of view. Also sources are not included since right now all code is in one since file and some parts will be moved to xsLib which will have a different license than the kernel (xsLib will be LGPL and the kernel GPL).
Download XSeal TT#1 from http://alfasphere.bsector.cjb.net/ (the site is the original site for The Force with the original name of it - i later changed it - or... gah, i don't remember :-p - i didn't even remembered AlfaSPHERE until i saw its directory in the server :-p). Click on the download link (i had to put it somewhere and my badsector.demoscene.gr server is down - a sf release is not an option, i don't want this to be permanently posted here).
Now how to use it. First of all, there are still DJGPP's keyboard functions. So type slowly (well not very slowly, but don't jam the keyboard typing).
Start xssh.exe (XSeal Shell). If everything works, you'll be in a console with blue background and bright blue letters (i like this color scheme - it reminds commodore 64). Now try to type something. If letters appear, then we're in a good road. Your computer is multitasking :-). Enter 'ps' to show the running processed. Currently you'll see only two: the kernel and the video driver.
Now let's put a new process. Type 'put 2'. You'll see that the third character of the console to ''change''. This is done in a separate process like this:
Code: |
while (1)
{
vbuffer[n << 1]++;
}
|
where n is the number you typed (well, there are some other bits involved -such as enabling a flag in order to update the screen- but practically this is done).
put some other 'increators' by typing put 1, put 4, put 6, put 12 and put 100. Notice that as you put more, the speed decreases. This happens because these processes are not friendly to others and want to take 100% of the CPU power. A solution would be to put a pause() like:
Code: |
while (1)
{
vbuffer[n << 1]++;
pause();
}
|
while is the same as POSIX pause(): it gives the rest of the timeslice to the next process. But since all our processes uses it, it won't provide much difference :-). In a real environment, however, it will (f.e. if you have a program that renders an image and is very CPU intensinve - f.e. it does it using photon mapping - it will appreciate it if a process gives the rest of its CPU time to it).
When you have enough increators on the screen (say around 15) type 'crash'. This will virtually crash the shell (actually it will enter in an infinite loop: while(1);). Now let XSeal to run for some minutes. If nothing odd happens, then there is probably no problem :-).
Now type Ctrl+Break to exit.
if XSeal crashes in any point, reboot and try again, at least for 5 times. This is known behaviour and currently i can't do anything...
[/url] _________________ main(){printf("Hello, world!n"); return 0;}
Bad Sector - http://www.bsector.cjb.net/ |
|
Back to top |
|
 |
orudge Administrator

Joined: 07 Oct 2001 Posts: 1332 Location: United Kingdom
|
Posted: Sat Apr 24, 2004 5:28 pm Post subject: |
|
|
Sounds good. Just going to try it out now.
EDIT: So far, not so good. It doesn't work at all on Windows XP. I realise, of course, that this is a GUI for DOS (I just don't have any form of DOS on my laptop ). Will try it tomorrow (well, later today, technically). _________________ Owen Rudge
http://www.owenrudge.net/
Currently Playing (last time I was online, anyway):  |
|
Back to top |
|
 |
dlormand
Joined: 15 Apr 2004 Posts: 5 Location: Tucson, Arizona, USA
|
Posted: Sun Apr 25, 2004 4:06 pm Post subject: |
|
|
Okay, I just tried it on several machines here.
DRDOS works fine.
FreeDOS doesn't work very well at all, at least this "older" kernel (2030) doesn't. Surprisingly, the 386 does best. Most lock up after one keypress. I think moving out on the toolset should be Job 1, if you are needing multitasking-friendly library routines. I will try kernel 2034 and get back to you, but I don't think this will change the fundamental issue. |
|
Back to top |
|
 |
dlormand
Joined: 15 Apr 2004 Posts: 5 Location: Tucson, Arizona, USA
|
Posted: Sun Apr 25, 2004 4:23 pm Post subject: |
|
|
Nope. Kernel 2034 doesn't do any better. Or is this the right variable? Is there some other part of FD0.9 that is responsible for handling keyboard?
DRDOS does everything you want on this 486-100. No perceptible slowdown even after
fifteen "puts". Keeps working after "crash" for half an hour. Break works fine. |
|
Back to top |
|
 |
BadSector Administrator

Joined: 24 Oct 2001 Posts: 328 Location: Greece, Samos
|
Posted: Mon Apr 26, 2004 5:40 am Post subject: |
|
|
i use the "latest" (or one of the latest) beta versions of FreeDOS. I haven't tried to use DRDOS or MSDOS (i need FAT32 support), except the MSDOS that comes with Windows ME (where i didn't find any problem - but i didn't tried that hard).
I don't know what FreeDOS does, but it seems that it goes to protected mode and then back to v86 mode or something. Maybe it tries to provide a VCPI or DPMI or something. FreeDOS' keyboard routines needs a bit of improvement (it's easy to completelly crash my system by pressing tab... even the keyboard leds doesn't change, which is a sign of protected mode).
In any case, the problem is not the 'puts' but the keyboard itself (i don't know if FreeDOS makes XSeal's multitasking to slow down, but i don't believe that that happens).
Now i have to work on the keyboard driver... _________________ main(){printf("Hello, world!n"); return 0;}
Bad Sector - http://www.bsector.cjb.net/ |
|
Back to top |
|
 |
dlormand
Joined: 15 Apr 2004 Posts: 5 Location: Tucson, Arizona, USA
|
Posted: Mon Apr 26, 2004 8:19 am Post subject: |
|
|
Quote: | i use the "latest" (or one of the latest) beta versions of FreeDOS. I haven't tried to use DRDOS or MSDOS (i need FAT32 support) |
2034 came out last week. But in truth, I always get the FAT16 version. This is only filesystem support, though, so I can't see why it should have any effect on keyboard handling. Interesting that it works for you but not for me...
Quote: | In any case, the problem is not the 'puts' but the keyboard itself (i don't know if FreeDOS makes XSeal's multitasking to slow down, but i don't believe that that happens). |
Yes, the keyboard locked up before I even had a chance to start a "put".
Would processor speed influence multitasking? I wouldn't think so. And under FD0.9, the lockup happens on anything from a 386 to a P-266 (but I can type TWO characters on the 386...).
Quote: | Now i have to work on the keyboard driver... |
Mmm okay, but how much of this problem is a less-than-polished keyboard driver versus its use of non-threadsafe library routines? If you know that we will need to port the "real" libc eventually, how much of these problems might be solved if we did it sooner rather than later?
Or is multitasking even in play in the TT1 until you start a "put"? |
|
Back to top |
|
 |
BadSector Administrator

Joined: 24 Oct 2001 Posts: 328 Location: Greece, Samos
|
Posted: Tue Apr 27, 2004 9:23 am Post subject: |
|
|
Quote: |
2034 came out last week. But in truth, I always get the FAT16 version. This is only filesystem support, though, so I can't see why it should have any effect on keyboard handling.
|
There isn't any relation. I need FAT32 because i have DJGPP in a FAT32 partition .
Quote: |
Would processor speed influence multitasking? I wouldn't think so. And under FD0.9, the lockup happens on anything from a 386 to a P-266 (but I can type TWO characters on the 386...).
|
The multitasker is based on the PIC chip that as far as i know has the same speed in alls computers. So processor speed is not a problem, i suppose.
Quote: |
Mmm okay, but how much of this problem is a less-than-polished keyboard driver versus its use of non-threadsafe library routines? If you know that we will need to port the "real" libc eventually, how much of these problems might be solved if we did it sooner rather than later?
|
i had none problems with threads working exclusive without DJLIB.
I don't know how much of the problems will be solved, since i don't know how thread aware DJLIB is. I suspect, however, that it is not thread aware, since DOS doesn't support threads....
I'm not sure if i port the GNU C library or if i write another one, since the XSeal situation is a bit strange. If i do, however, i'll need to implement lots of -POSIX- stuff (which is not a bad thing, since POSIX's purpose is to provide compatibility in source code level, but then it is not an easy thing either)...
Quote: |
Or is multitasking even in play in the TT1 until you start a "put"?
|
Yes it is. When you are in the command prompt, two tasks are running: the one is the kernel (and the shell, since in TT1 it is actually a part of the kernel) and the other is the video driver (which is just a task that updates the screen's contents from a buffer). It *is* possible that the video driver causes crash (since it uses the DJLIB function movedata), but i disable multitasking before i make the DJLIB call and i enable it after the function returns. So i don't believe that this is a problem.... however i found that there is a bug in disabling/enabling multitasking which really makes the system to lock. I don't know why that happens, but i'm working on it. The method i use is to have two functions "enableMultitasking" and "disableMultitasking" which increases and decreases a variable respectivelly. The scheduler just checks if the variable is positive (including zero) or negative and if it is negative then it doesn't switch to the next task. But if i use these functions in more than one task, the system locks up (pressing ctrl+break will, in most cases, return to DOS so this means that the variable is messed somewhere - not that the system really crashes). _________________ main(){printf("Hello, world!n"); return 0;}
Bad Sector - http://www.bsector.cjb.net/ |
|
Back to top |
|
 |
RThanos
Joined: 21 May 2004 Posts: 3 Location: Louisiana, USA
|
Posted: Sun May 23, 2004 5:46 pm Post subject: |
|
|
A month late and 25 cents short......... Here are My results
Test machine:
IBM PC 340
Pentium 99Mhz
16 Mb Ram
800 and change Mb HD
PC-DOS 7
Results:
Ran almost without a hitch, Exit Command even works (once).
Only encountered keyboard lockup after 'crash' command or after
'ctrl-break'ing out of the program.
Opinions:
I like it.
True multitaskinging is by far better than the 'Megatasking'(tm)
done by win3.1 and (at least in part) its decendants.
Possible issues:
None at this point, previous posts have addressed them _________________ "Learn what you will,
Harming none,
That is the law"
Hackers Rote - RThanos |
|
Back to top |
|
 |
ncwebmaster
Joined: 28 Dec 2003 Posts: 2
|
Posted: Tue May 25, 2004 8:49 am Post subject: Re: XSeal Technology Test #1 |
|
|
BadSector wrote: | Well, finally there is something to see.
XSeal Technology Test #1 is the result of my work from the day i became the maintainer until today (ok, actually until yesterday night ). I wasn't giving all my time here, so i suppose that if i did, the project could be made in, hm, less than a week. But i have a so-called real life and many more projects to deal with (which currently they have higher priority) so this is why it took so long.
The keyboard driver is still missing, but i've made a progress on it. I found some decent docs about how it works and i managed to read some keyb state bits. Unfortunatelly writing a keyboard driver needs a lot more work than i thought, since some keyboards behave differently than others. Anyway, i'll deal with it...
This Technology Test is not a prerelease, alpha, beta, preview or something. It's what its name says: a technology test. I'm releasing it in order to test the multitasking code that the XSeal will use. Try to run it in your computer and tell me the results.
There are NO graphics, NO sound, NO dynamic linking (libraries, executables), NO security and nothing usefull from a practical point of view. Also sources are not included since right now all code is in one since file and some parts will be moved to xsLib which will have a different license than the kernel (xsLib will be LGPL and the kernel GPL).
Download XSeal TT#1 from http://alfasphere.bsector.cjb.net/ (the site is the original site for The Force with the original name of it - i later changed it - or... gah, i don't remember :-p - i didn't even remembered AlfaSPHERE until i saw its directory in the server :-p). Click on the download link (i had to put it somewhere and my badsector.demoscene.gr server is down - a sf release is not an option, i don't want this to be permanently posted here).
Now how to use it. First of all, there are still DJGPP's keyboard functions. So type slowly (well not very slowly, but don't jam the keyboard typing).
Start xssh.exe (XSeal Shell). If everything works, you'll be in a console with blue background and bright blue letters (i like this color scheme - it reminds commodore 64). Now try to type something. If letters appear, then we're in a good road. Your computer is multitasking . Enter 'ps' to show the running processed. Currently you'll see only two: the kernel and the video driver.
Now let's put a new process. Type 'put 2'. You'll see that the third character of the console to ''change''. This is done in a separate process like this:
Code: |
while (1)
{
vbuffer[n << 1]++;
}
|
where n is the number you typed (well, there are some other bits involved -such as enabling a flag in order to update the screen- but practically this is done).
put some other 'increators' by typing put 1, put 4, put 6, put 12 and put 100. Notice that as you put more, the speed decreases. This happens because these processes are not friendly to others and want to take 100% of the CPU power. A solution would be to put a pause() like:
Code: |
while (1)
{
vbuffer[n << 1]++;
pause();
}
|
while is the same as POSIX pause(): it gives the rest of the timeslice to the next process. But since all our processes uses it, it won't provide much difference . In a real environment, however, it will (f.e. if you have a program that renders an image and is very CPU intensinve - f.e. it does it using photon mapping - it will appreciate it if a process gives the rest of its CPU time to it).
When you have enough increators on the screen (say around 15) type 'crash'. This will virtually crash the shell (actually it will enter in an infinite loop: while(1) . Now let XSeal to run for some minutes. If nothing odd happens, then there is probably no problem .
Now type Ctrl+Break to exit.
if XSeal crashes in any point, reboot and try again, at least for 5 times. This is known behaviour and currently i can't do anything...
[/url] |
Source Code ????? |
|
Back to top |
|
 |
BadSector Administrator

Joined: 24 Oct 2001 Posts: 328 Location: Greece, Samos
|
Posted: Mon Jun 07, 2004 8:02 am Post subject: |
|
|
Someone (i can't remember who) from ICQ told me that he'll write a keyboard driver for me.... i'm still waiting .
If anyone can do it, feel free to do so. I only need one function that checks if there is a keystroke available and if so to return it. This is the most basic form. An interrupt-driven approach could be better since it will leave a lot of CPU cycles, but the beginning is the halfway for the end (free translation of a Greek saying). _________________ main(){printf("Hello, world!n"); return 0;}
Bad Sector - http://www.bsector.cjb.net/ |
|
Back to top |
|
 |
ucosty

Joined: 02 Dec 2003 Posts: 41 Location: Australia
|
Posted: Fri Jun 18, 2004 10:06 pm Post subject: |
|
|
Just in case you still need a semi-working keyboard driver. This is from my operating system project UOS.
Code: |
kbd.h
#define F1 0x80
#define F2 (F1 + 1)
#define F3 (F2 + 1)
#define F4 (F3 + 1)
#define F5 (F4 + 1)
#define F6 (F5 + 1)
#define F7 (F6 + 1)
#define F8 (F7 + 1)
#define F9 (F8 + 1)
#define F10 (F9 + 1)
#define F11 (F10 + 1)
#define F12 (F11 + 1)
#define INS 0x8C
#define DEL (INS + 1)
#define HOME (DEL + 1)
#define END (HOME + 1)
#define PGUP (END + 1)
#define PGDN (PGUP + 1)
#define LEFT 0x92
#define UP (LEFT + 1)
#define DOWN (UP + 1)
#define RT (DOWN + 1)
#define SCROL 0x96
#define CAPS (SCROL + 1)
#define NUM (CAPS + 1)
#define SHIFT 0x99
#define ALT (SHIFT + 1)
#define CTRL (ALT + 1)
#define LEFT 0x92
#define UP (LEFT + 1)
#define DOWN (UP + 1)
#define RT (DOWN + 1)
|
Code: |
kbd.c
#include <drivers/kbd.h>
//keyboard queue
char queue[100];
int queuelen = 0;
//modifiers
int shift=0;
int caps;
//keycode mappings
static const unsigned char normmap[100] =
{/* 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F */
/*00*/ 0, 0x1B, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b', '\t',
/*10*/ 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', CTRL, 'a', 's',
/*20*/ 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', SHIFT,'#', 'z', 'x', 'c', 'v',
/*30*/ 'b', 'n', 'm', ',', '.', '/', SHIFT,0, ALT, ' ', CAPS, F1, F2, F3, F4, F5,
/*40*/ F6, F7, F8, F9, F10, NUM, SCROL,HOME, UP, PGUP, '-', LEFT, '5', RT, '+', END,
/*50*/ DOWN, PGDN, INS, DEL, 0, 0, '\\', F11, F12
};
static const unsigned char shiftmap[100] =
{/* 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F */
/*00*/ 0, 0x1B, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '\b', '\t',
/*10*/ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', CTRL, 'A', 'S',
/*20*/ 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '\"', '~', SHIFT,'|', 'Z', 'X', 'C', 'V',
/*30*/ 'B', 'N', 'M', '<', '>', '?', SHIFT,0, ALT, ' ', CAPS, F1, F2, F3, F4, F5,
/*40*/ F6, F7, F8, F9, F10, NUM, SCROL,HOME, UP, PGUP, '-', LEFT, '5', RT, '+', END,
/*50*/ DOWN, PGDN, INS, DEL, 0, 0, '|', F11, F12
};
static const unsigned char capsmap[100] =
{/* 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F */
/*00*/ 0, 0x1B, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b', '\t',
/*10*/ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']', '\n', CTRL, 'A', 'S',
/*20*/ 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', '\'', '`', SHIFT,'\\', 'Z', 'X', 'C', 'V',
/*30*/ 'B', 'N', 'M', ',', '.', '/', SHIFT,0, ALT, ' ', CAPS, F1, F2, F3, F4, F5,
/*40*/ F6, F7, F8, F9, F10, NUM, SCROL,HOME, UP, PGUP, '-', LEFT, '5', RT, '+', END,
/*50*/ DOWN, PGDN, INS, DEL, 0, 0, '\\', F11, F12
};
static const unsigned char capsshiftmap[100] =
{/* 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F */
/*00*/ 0, 0x1B, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '\b', '\t',
/*10*/ 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', CTRL, 'a', 's',
/*20*/ 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', SHIFT,'|', 'z', 'x', 'c', 'v',
/*30*/ 'b', 'n', 'm', ',', '.', '/', SHIFT,0, ALT, ' ', CAPS, F1, F2, F3, F4, F5,
/*40*/ F6, F7, F8, F9, F10, NUM, SCROL,HOME, UP, PGUP, '-', LEFT, '5', RT, '+', END,
/*50*/ DOWN, PGDN, INS, DEL, 0, 0, '|', F11, F12
};
void kbd_irq()
{
//temp vars
unsigned char scan_code;
unsigned char converted;
//////////////////
// get scancode //
//////////////////
scan_code = inportb(0x60);
//////////////////////
// key decoder code //
//////////////////////
if(scan_code <= 0x58) {
//keymap selector
if(shift == 0)
{
if(caps == 0)
//no caps, no shift
converted = normmap[scan_code];
else
//caps, no shift
converted = capsmap[scan_code];
}
else
{
if(caps == 0)
//no caps, shift
converted = shiftmap[scan_code];
else
//caps, shift
converted = capsshiftmap[scan_code];
}
//regular key
queue[queuelen] = converted;
queuelen++;
}
/////////////////////////
// Shift modifier code //
/////////////////////////
if(scan_code == 42 || scan_code == 54) {
shift = 1;
}
if(scan_code == 170 || scan_code == 182) {
shift = 0;
}
////////////////////////////
// Capslock modifier code //
////////////////////////////
if(scan_code == 0x3A ) {
if(caps == 0) {
caps = 1;
}
else {
caps = 0;
}
}
//clear keyboard handler
outportb(0x20, 0x20);
}
char getc()
{
char retval;
int i;
//if key cache queue is empty return zero
if(queuelen == 0)
return 0;
//set first
retval = queue[0];
//shift queue down one position
for(i = 1;i < queuelen;)
{
queue[i - 1] = queue[i];
i++;
}
//decrement queue counter
queuelen--;
//return keycode
return retval;
}
void gets(char *str)
{
unsigned char c = 0, ret = '\n';
int count = 0;
unsigned char tempstring[2];
tempstring[1] = '\0';
while(1)
{
while((c = getc()) == 0){
}
if(c == ret) break;
if(c == '\b'){
if(count != 0){
count--;
printf("\b \b");
}
}else if(c >= 0x20 && c <= 0x7E){
str[count] = c;
count++;
tempstring[0] = c;
printf(tempstring);
}
}
printf("\n");
str[count] = '\0';
}
|
I couldn't care less what you do with this code. Consider it released public domain. (Just this code segment, not the whole os )
additional: This is an IRQ routine. You need to somehow attatch the appropriate keyboard IRQ to the kbd_irq() function. This is done through an assembly stub in my operating system. This is becasue there is no interrupt (i think thats what it is) keyword in GCC.
edit: but you would know that, anyway, since you did hijack the timer interrupt (didnt you?) |
|
Back to top |
|
 |
BadSector Administrator

Joined: 24 Oct 2001 Posts: 328 Location: Greece, Samos
|
Posted: Sat Jul 24, 2004 11:04 am Post subject: |
|
|
i saved the whole thead. I'll check your code at home, thanks  _________________ main(){printf("Hello, world!n"); return 0;}
Bad Sector - http://www.bsector.cjb.net/ |
|
Back to top |
|
 |
bionicbeast_
Joined: 27 Oct 2004 Posts: 1
|
Posted: Wed Oct 27, 2004 9:14 am Post subject: |
|
|
Hey there,
I got it working on a P1 133Mhz clocked on 200Mhz with 48 mb ram in FreeDOS kernel 2035 with screenmode 80,43.
[edit] Oh yeah, it only used half the screen in that screenmode.
I hope this post was any use to you.
(ps. keep up the good work) |
|
Back to top |
|
 |
poundsmack
Joined: 31 Dec 2002 Posts: 50
|
Posted: Fri Jan 13, 2006 2:53 pm Post subject: |
|
|
so any news on this? |
|
Back to top |
|
 |
lighting
Joined: 12 Aug 2004 Posts: 3
|
Posted: Thu Feb 02, 2006 5:20 pm Post subject: |
|
|
Tis just me, but I doubt there will ever be news... pity, too... SEAL was pretty damn good as far as windowing systems go.
--Nick |
|
Back to top |
|
 |
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|