flat assembler
Message board for the users of flat assembler.

Index > OS Construction > FASM Challenge - For all users

Goto page Previous  1, 2, 3, ... 13, 14, 15  Next
Author
Thread Post new topic Reply to topic
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
Octavio wrote:
...The problem is just to write the code.
Sure, and with a net based effort, the real problem then, is to translate an algorithm into READABLE code, so that several folks working on the same project need not spend more time trying to understand, and debugging, someone else's errors, than would be required if they simply wrote all the code by themselves....Since this thread had no takers for the individual challenge, it makes more sense to offer it, instead, as a net wide, not one person, contest, where the goal is to accomplish this task with a P4 or equivalent cpu, minimum 256 mbytes memory, SATA or IDE drive, and DSL or cable modem (already powered up): start stop watch: cpu power on, FASM forum appears, stop watch off, maximum three seconds elapsed, with or without any particular OS.
Smile
Post 21 Jan 2008, 12:27
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
minimal requirement need to be the same as fasm
386
and for memory, i think the minimum is 16 M

drive requirement:
support of chs, lba and sata

the browser itself must be started one second after bootstrap.
for the rest, it take the time it need to take, we cannot act on network speed, but on machine speed.

for network capabilities, dsl, cble modem, and perhaps serial modem..

for graphics, the maximal is resolution of lcd screen or 1024*768
it shall test for available modes and switch to the bigger resolution within the limit of 1024*768 or current lcd screen (to avoid screen expansion).

this is a contest because it will force us to work togheter, are we able to do that?
Post 21 Jan 2008, 14:02
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
DexOS can do 95% of the challenge (as it has a full tcp/ip stack), but unless you fake it, you can not do it in the time.
Example i can boot to the CLI in DexOS in less than a second, but if i enable mouse support, it will add another 2 seconds.
So tom tobias time is more realistic.

But it is a very good challenge.
Post 21 Jan 2008, 20:00
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
but if i enable mouse support, it will add another 2 seconds.

why?
Post 21 Jan 2008, 20:18
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
tom tobias wrote:
the real problem then, is to translate an algorithm into READABLE code, so that several folks working on the same project need not spend more time trying to understand
Where possible shouldn't the coding abstractions match existing documentation (preferably from the source). Thereby further minimizing the need to document the code? Not that all the abstractions need to be utilized.

The other approach would be to trust sections of code to a group of individuals and treat it like a blackbox - makes debugging and changes less friendly - imho, anyone should be able to provide suggestions or make bug fixes. Anyhow, the documentation for the interface should be a prerequisite for the code.

I'm okay reading code that looks like a disassembly listing, but if it's dense I like to add hints every half page or so. My memory ain't what it used to be, or maybe my attention is just more divided.
Post 21 Jan 2008, 20:57
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I would say its because of the wait loops and delay loops etc.
example (call in realmode on booting)
Code:
;====================================================;; keyboardRead.                                      ;;====================================================;keyboard_read:     push  ecx     push  edx     mov   ecx,0xffffkey_read_loop:  in    al,0x64 test  al,1    jnz   key_read_ready  loop  key_read_loop   mov   ah,1    jmp   key_read_exitkey_read_ready:      push  ecx     mov   ecx,32key_read_delay:     loop  key_read_delay  pop   ecx     in    al,0x60 xor   ah,ahkey_read_exit:       pop   edx     pop   ecx     ret    


Now you also have "keyboard_write" and "keyboard_cmd" with simular loops as above, together these functions are called 20 times in the setup code.
It soon builds up
Post 21 Jan 2008, 20:58
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
Code:
keyboard_read:
        push  ecx
        mov   ecx,0xffff
        mov   ah,1
key_read_loop:
        in    al,0x64
        test  al,ah
        loope key_read_loop
        je    key_read_exit
        mov   ecx,32
        xor   ah,ah
key_read_delay:
        loop  key_read_delay
        in    al,0x60
key_read_exit:
        pop   ecx
        ret    
Edit: had branch conditions incorrect. Why is EDX push/pop 'd?
Post 21 Jan 2008, 21:32
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
hem, about keyboard, i don't see any reason to have some delays into.

my int9 handler is fast, very fast. and don't need to be called 20 times in setup because it provide a full keyboard map in memory that can be read from anywhere.
only two bugs are persistant:
pause key that is not existing.
flip flop keys (scroll lock, num lock, insert and majlock) that blink in boot mode, but are ok in dos mode. strange...
and a lack of bios functions. but it can be used as a keyboard handler in PM as in RM, and the fact it don't need to be called is good for speed.

what about the mouse support and the PHP support? + html and http?

i think that if we all participate to this project, we need to make separate .inc files as a librairy, and then finally make the meta "main.asm" file in less than 200 lines.

if all is cutted into elemental blocks instead of a big asm file, it can be easier to fix errors and bugs, and easier to learn the global structure and the basic features of all functions...

Code:
includes.inc:
...
include 'int9.inc'
include 'mouse.inc'
include 'php.inc'
include 'graphlib.inc'
include 'syslib.inc'
include 'disk.inc'
include 'network.inc'
include 'vesa.inc'
include 'audio.inc'
...

    

Code:
graphlib.inc
...
include 'line.inc'
include 'box.inc'
include 'fnt.inc'
include 'text.inc'
include 'paint.inc'
include 'gif.inc'
include 'jpg.inc'
include 'bmp.inc'
include 'png.inc'
...
    

Code:
syslib.inc:
...
include 'emm.inc'
include 'fs.inc'
include 'page.inc'
include 'file.inc'
include 'request.inc'
include 'syscall.inc'
include 'exitor.inc'  ;like terminator
include 'enteror.inc' ;or predator Wink
include 'reboot.inc'
...
i don't have any idea about what is needed in system include...
    


etc etc...
Code:
main.asm:
...
include 'includes.inc'
...
syscall reboot
    


here the difuculty is to find what to write at ... locations. Laughing


Last edited by edfed on 22 Jan 2008, 08:12; edited 1 time in total
Post 21 Jan 2008, 23:40
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
edfed wrote:
hem, about keyboard, i don't see any reason to have some delays into.

my int9 handler is fast, very fast. and don't need to be called 20 times in setup because it provide a full keyboard map in memory that can be read from anywhere.
This not for keyboard, its for setting up mouse. The PS/2 mouse uses the same protocol as the PS/2 keyboard (aka AT keyboard).
Here is what win98 does to setup mouse
Quote:

The following is the communication between my computer (running Win98SE) and mouse when it boots up with a standard PS/2 mouse attached.  It is fairly typical of how a PS/2 mouse is initialized and if you want to emulate a PS/2 mouse it must (at minimum) be able to support the following sequence of commands... 

Power-on Reset:

Mouse: AA  Self-test passed
Mouse: 00  Mouse ID
Host:  FF  Reset command
Mouse: FA  Acknowledge
Mouse: AA  Self-test passed
Mouse: 00  Mouse ID
Host:  FF  Reset command
Mouse: FA  Acknowledge
Mouse: AA  Self-test passed
Mouse: 00  Mouse ID
Host:  FF  Reset command
Mouse: FA  Acknowledge
Mouse: AA  Self-test passed
Mouse: 00  Mouse ID
Host:  F3  Set Sample Rate   : Attempt to Enter Microsoft
Mouse: FA  Acknowledge       : Scrolling Mouse mode
Host:  C8  decimal 200       :
Mouse: FA  Acknowledge       :
Host:  F3  Set Sample Rate   :
Mouse: FA  Acknowledge       :
Host:  64  decimal 100       :
Mouse: FA  Acknowledge       :
Host:  F3  Set Sample Rate   :
Mouse: FA  Acknowledge       :
Host:  50  decimal 80        :
Mouse: FA  Acknowledge       :
Host:  F2  Read Device Type  :
Mouse: FA  Acknowledge       :
Mouse: 00  Mouse ID          : Response 03 if microsoft scrolling mouse
Host:  F3  Set Sample Rate 
Mouse: FA  Acknowledge
Host:  0A  decimal 10
Mouse: FA  Acknowledge
Host:  F2  Read Device Type
Mouse: FA  Acknowledge
Mouse: 00  Mouse ID
Host:  E8  Set resolution
Mouse: FA  Acknowledge
Host:  03  8 Counts/mm
Mouse: FA  Acknowledge
Host:  E6  Set Scaling 1:1
Mouse: FA  Acknowledge
Host:  F3  Set Sample Rate
Mouse: FA  Acknowledge
Host:  28  decimal 40
Mouse: FA  Acknowledge
Host:  F4  Enable
Mouse: FA  Acknowledge
Initialization complete...

See here:
http://www.computer-engineering.org/ps2mouse/
Any way back on topic, i have alway found using .inc file, makes add and debuging much easier.
But some of the stuff on the list are not easy to code.
example it took me 2 years to get .png, .gif, .jpg decoders done.

PS. That push edx, is because i used the same template for both keyboard_read and keyboard_write and keyboard_write user's dl.
Post 22 Jan 2008, 01:33
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
i don't speak about making all alone.

if somebody have made some stuff, we just have to adap it for this contest...

i think the harder is to provide a function set in includes that can be understood by everyone and simple to call.

about this mouse setup, i don't see where it need two seconds to execute...

an dfor people that think it's not a real trick to use pre made fasm functions, it's false, optimisation is always possible, and you'll can make your own code based on the basic ones...

the contest need to be cutted in 3 stages:

1) find all needed function and make a package
2) program toghether a basic browser that is able to browse fasm forum and probably google...
3) make the real contest, PROGRAMMING alone a better browser than the basic one, make some optimisations, possible to work in little groups (two or tree persons, not more)

and finally, the winner is tomasz, cause his program is needed to make it...

i hope this will be done... it's seriously fun Wink
Post 22 Jan 2008, 01:38
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I like it, once we decide what is needed, we can ask individual's or groups to take on that part of the project, that they want to code.
Post 22 Jan 2008, 01:59
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17719
Location: In your JS exploiting you and your system
revolution
Dex4u wrote:
Example i can boot to the CLI in DexOS in less than a second, but if i enable mouse support, it will add another 2 seconds.
Time consuming operations like that are good candidates for offloading to a thread. The delay loops can be converted to sleeps, or, if possible and preferable, interrupts. Think of it like preparing a meal, get multiple things cooking at the same time.
Post 22 Jan 2008, 05:17
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
revolution wrote:
Dex4u wrote:
Example i can boot to the CLI in DexOS in less than a second, but if i enable mouse support, it will add another 2 seconds.
Time consuming operations like that are good candidates for offloading to a thread. The delay loops can be converted to sleeps, or, if possible and preferable, interrupts. Think of it like preparing a meal, get multiple things cooking at the same time.


I have already implemented multi-threading, with sleep etc, which will work even in realmode, but i have not used it for speeding up booting, if it goes over 3 seconds, i probably will.
Or i can do like windows and boot to the desktop, but still have 90% of stuff to load and set up Laughing
Post 22 Jan 2008, 08:19
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
the critical objective is the ONE second operability.
ONE second after bootstrap, not more.

it is possible as 1 second for a 100 Mhz correspond to 100 000 000 clock cycles, largelly enough to initialise all components.
Post 22 Jan 2008, 10:19
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
On my Os the keyboard + mouse setup only takes 0.7 seconds, i think
the secuence used by windows 98 is not really required, command
0ffh (reset) is send 3 times and each time it needs 0.3 seconds to complete, but is really needed to reset 3 times the mouse?
From all my tests one reset is enought.
Note that a P4 with 256MB ram will not help here Smile
but still can be done in one second.
Post 22 Jan 2008, 10:30
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
yeah, congratulation, but...
the mouse can be initialised for the extended function while first loading of program.
operability is the ability to print keystrokes, move mouse cursor, launch an executable and execute a command. by evidence, the first loading will take more than one second if it's a big file. so don't care about speed in this case.

for mormal mouse support, no init needed?

ONE second maximum to launch the brower. ONE second. maximum. there is the challenge, i hope it's OK in all minds.

windows is not a refence in this domain... my best score is 17 seconds for operability and 25 seconds to launch IE, on 98. this score is largelly too much.

so, i think octavio's mouse setup is good for this contest.
i think we'll need a tread for file sharing and updates, with hard moderation, one autor, one unique file/package. one file/package, one post, the best one chosen by jury.
jury will be chosen soon... i hope i'll be one of the judges, instead to be a good coder, i can be good judge abou performance, without any pity for slow codes ... Wink
for keyboard, i think the best way to support a fast keyboard is to build a keytable, like dex, me and others wrote. it's faster to access byte in table than to IN AL, 60h or INT niania.
Post 22 Jan 2008, 10:58
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
http://tunes.org/wiki/unununium.html
http://unununium.org/

I always liked that idea:
Quote:
Everything is dynamic, so that cells can install and replace cells at runtime without need to bring down the system, a paradigm they name "organic software".
...not at all easy to get right.
Post 22 Jan 2008, 14:46
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
so...

LocoDelAssembly
BitRake
Octavio
Tom Tobias
Dex4u
Revolution
vid?

at least 7 persons + 1 are interested in this project?

it can be good to have motivation and active participations.
this project is not impossible to achieve.

perhaps the 1 second constraint is too much for the beginnig.
real contest can start when we have at least 3 seconds for net-explorator to be launched.
3 seconds seems to be reasonable, no?

3 seconds from bootloading, the org 7c00h code located at sector 0 of boot drive.

1.5s for hardware init
1s for librairy loading
0.5s as padding or in case of impossible time achievement for the two first steps...

what do you think about this contest? is it possible that we can work together on stuff like this? and how long can we work together without brain saturation?

if we start this week, it is possible to complete the basic system before north-pole's summer.


Last edited by edfed on 22 Jan 2008, 19:28; edited 1 time in total
Post 22 Jan 2008, 16:11
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I think the best plan will be to get it working, then optimise it for speed to achieve out goal, if we get it to 3 seconds, we can then find the bottle necks and get it down to 1 second.
We also need to define a licence, i like the one DexOS users, which is anyone that add to it, is joint owner.

Also we need to decide basic OS design, eg multi-tasking, paging or single-tasking nopaging etc.
Post 22 Jan 2008, 16:52
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4242
Location: 2018
edfed
multi tasking:
without tss
paging:
yes but after...
licence:
yes, but not DEXOS and not UFO NOSS.
a licence applied for each modules.
a multilicence, it will make feel crazy all the stealers of code if they see the code is in multilicence...yesss
if a module is in DEXOS, it rest in DEXOS
if a module is in GPL, it rest in GPL, but the others parts are not in GPL.
if a module is in XXX licence, it rest in XXX licence.

for OS design, we need to wait for more participants, cause if we are only 2 or 3, it will never appear before this summer (and if we wait too long for other coders, it will never appear at all) .

DEX and all:
we are you the best in coding?
system?
gui?
hardware?
...?
the task will be repartited between coders as their habilities.
for exemple, me, i want to code some hardware, and some layers as linking between modules and french support.

we need to adapt modules with the same convention.
and many conventions can be defined,
one package = one convention

please, don't let it die.
Post 22 Jan 2008, 19:27
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, ... 13, 14, 15  Next

< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.