10-21-2003, 05:16 PM
::blitz::
can you list all the floating point instructions the CPU/FPU has, with the cycle count of each? i just wonder what a library has to write for itself and what it can rely on the cpu for.
::loosecaboose::
i've really taken vema a long way already (vema... remember, that virtual message-passing o/s i started in qb... http://forum.qbasicnews.com/viewtopic.ph...light=vema) .
i moved to c++, i dont use any libraries like STL/MFC, etc., i've written my own classes for string, queue, array, etc., implementing them with only the functions i need and the way i want them. for example, my array has no "removeAt" method, and my queue class is synch'ed and can add blocks dynamically (you know, a cyclic queue, where you write at one block and lock it for reading, then read from block and lock it from writing, and then free it).
i was very happy the way i implemented it, considering i have never taken computer classes or other things that teach you how to do things. ANYWAY.
unlike minix (which i downloaded the src of), i'm not writing an os, i'm writing an oe (operation environment), something like a virtual machine that provide certain facilities like resource and memory management, but no files, for instance. the point of vema is not to run on any real computer or achieve any real functionallity; i do it for research only. currently it runs over windows, but i guess that since i never used any windows-specific libs, i could port it anywhere.
so, as i stated, vema is unlike minix. device drivers are not hardcoded into the kernel. the kernel provides only msg passing and msg handling. apart from that, the system predefines three resources: keyboard, mouse, and console. but, i stress again, these resources have no internal drivers. the keyboard just contains a buffer of 256 bytes, to which the key-state-map is copied by the kernel. now, some driver, called the keyboard driver, must poll this map, hold key-stroke counts, and send messages such as keydown/up/press. a second driver, called terminal driver, listens to these messages, and according to it's layout (en-us, for instance) will convert the keypress msgs to ascii, taking into account the state of the shifts and capslock. this works in theory, but i dont like the way the keyboard driver must do polling. i could of course define "virtual interrupts", e.g., the kernel sends RESOURCE_IN messages when a resource has some input, and then the keyboard driver will wake to read what's been pressed... but that scheme is fit only for input devices like the keyboard.
the console, for instance, is just a buffer of 80x25 characters. the terminal driver listens to MSG_TERM_WRITE msgs, etc., and writes characters to the console buffer, taking care of scrolling down when needed and moving the cursor. so an output-only device like the console does not fit the virtual interrupt scheme.
another thing is, creating resources on runtime. as i explained, the driver is just an app running in my VM, that provides a layer of abstraction to its users. just like that, a driver may allocate a block of memory and utilize it as a virtual disk, holding virtual files.
an app would send a create-file message, the disk driver would accept it, allocate a starting virtual sector, register that virtual file in some array, and return a handler. now, the app could send file-write or file-read messages like the normal file api we know.
another thing could be virtual hardware devices. i could just fill the resource buffer with some arbitrary data and let it process it. for example, every 100ms, i would fill the mouse-buffer with random data, then the mouse driver would process this data and move the mouse on the screen accordingly. that's just an example.
predefined resources mean that the resource's buffer is filled with raw input by the kernel. but if i could mimic raw input, by "manually"
having an app filling it for me, i could define any number of resources on runtime.
now that i think of it... the virtual interrupt method does work. i generalized it enough in my head already. shucks. i wrote all this in vain anyway, consider this a "progress report". if you have any comments, please do reply.
of course i still have problems with memory management... should it me dynamic? static? use a stack? a heap? pointers? qb-style? should everything be an object, like java/.net? making all variables objects makes life simpler for me, as i hold an array of variable-id's, each is associated a pointer to where the data is stored. this way, adding/removing vars is simple, but the overhead is quite large.
another problem i think i have is with multiple tasks of the same trap running simultaneously. but i'm not sure it's a problem :oops: ... i'd have to test it and see.
::other people::
get off my case
[Flexibal>
can you list all the floating point instructions the CPU/FPU has, with the cycle count of each? i just wonder what a library has to write for itself and what it can rely on the cpu for.
::loosecaboose::
i've really taken vema a long way already (vema... remember, that virtual message-passing o/s i started in qb... http://forum.qbasicnews.com/viewtopic.ph...light=vema) .
i moved to c++, i dont use any libraries like STL/MFC, etc., i've written my own classes for string, queue, array, etc., implementing them with only the functions i need and the way i want them. for example, my array has no "removeAt" method, and my queue class is synch'ed and can add blocks dynamically (you know, a cyclic queue, where you write at one block and lock it for reading, then read from block and lock it from writing, and then free it).
i was very happy the way i implemented it, considering i have never taken computer classes or other things that teach you how to do things. ANYWAY.
unlike minix (which i downloaded the src of), i'm not writing an os, i'm writing an oe (operation environment), something like a virtual machine that provide certain facilities like resource and memory management, but no files, for instance. the point of vema is not to run on any real computer or achieve any real functionallity; i do it for research only. currently it runs over windows, but i guess that since i never used any windows-specific libs, i could port it anywhere.
so, as i stated, vema is unlike minix. device drivers are not hardcoded into the kernel. the kernel provides only msg passing and msg handling. apart from that, the system predefines three resources: keyboard, mouse, and console. but, i stress again, these resources have no internal drivers. the keyboard just contains a buffer of 256 bytes, to which the key-state-map is copied by the kernel. now, some driver, called the keyboard driver, must poll this map, hold key-stroke counts, and send messages such as keydown/up/press. a second driver, called terminal driver, listens to these messages, and according to it's layout (en-us, for instance) will convert the keypress msgs to ascii, taking into account the state of the shifts and capslock. this works in theory, but i dont like the way the keyboard driver must do polling. i could of course define "virtual interrupts", e.g., the kernel sends RESOURCE_IN messages when a resource has some input, and then the keyboard driver will wake to read what's been pressed... but that scheme is fit only for input devices like the keyboard.
the console, for instance, is just a buffer of 80x25 characters. the terminal driver listens to MSG_TERM_WRITE msgs, etc., and writes characters to the console buffer, taking care of scrolling down when needed and moving the cursor. so an output-only device like the console does not fit the virtual interrupt scheme.
another thing is, creating resources on runtime. as i explained, the driver is just an app running in my VM, that provides a layer of abstraction to its users. just like that, a driver may allocate a block of memory and utilize it as a virtual disk, holding virtual files.
an app would send a create-file message, the disk driver would accept it, allocate a starting virtual sector, register that virtual file in some array, and return a handler. now, the app could send file-write or file-read messages like the normal file api we know.
another thing could be virtual hardware devices. i could just fill the resource buffer with some arbitrary data and let it process it. for example, every 100ms, i would fill the mouse-buffer with random data, then the mouse driver would process this data and move the mouse on the screen accordingly. that's just an example.
predefined resources mean that the resource's buffer is filled with raw input by the kernel. but if i could mimic raw input, by "manually"
having an app filling it for me, i could define any number of resources on runtime.
now that i think of it... the virtual interrupt method does work. i generalized it enough in my head already. shucks. i wrote all this in vain anyway, consider this a "progress report". if you have any comments, please do reply.
of course i still have problems with memory management... should it me dynamic? static? use a stack? a heap? pointers? qb-style? should everything be an object, like java/.net? making all variables objects makes life simpler for me, as i hold an array of variable-id's, each is associated a pointer to where the data is stored. this way, adding/removing vars is simple, but the overhead is quite large.
another problem i think i have is with multiple tasks of the same trap running simultaneously. but i'm not sure it's a problem :oops: ... i'd have to test it and see.
::other people::
get off my case
[Flexibal>