cli in fasm (in >fasm<)
cli in fasm (in >fasm<)
could somebody give me some demo code on how to make my kernel do cli and get the users input. if you could give it to me in realmode that would be exelent
-
- Member
- Posts: 155
- Joined: Fri Oct 27, 2006 5:11 am
- Location: Oberbayern
- Contact:
Re: cli in fasm (in >fasm<)
My project (see sig) has a real mode CLI, albeit written for NASM syntax, but it'll be easy to convert.
M
M
MikeOS -- simple, well-documented x86 real-mode OS written in assembly language
http://mikeos.sourceforge.net
http://mikeos.sourceforge.net
Re: cli in fasm (in >fasm<)
thanks ill take a look at it
Re: cli in fasm (in >fasm<)
alright i will use it and convert it from nasm, but wheres the source?
-
- Member
- Posts: 155
- Joined: Fri Oct 27, 2006 5:11 am
- Location: Oberbayern
- Contact:
Re: cli in fasm (in >fasm<)
In the 'source' directory os_cli.asm in 2.0, or features/cli.asm in 2.9.3.
M
M
MikeOS -- simple, well-documented x86 real-mode OS written in assembly language
http://mikeos.sourceforge.net
http://mikeos.sourceforge.net
Re: cli in fasm (in >fasm<)
yep found it in the down load, thanks for the information!
Re: cli in fasm (in >fasm<)
You could also take a look at MiniDos, which is real mode, written in fasm and has a CLI.
see here: http://board.flatassembler.net/topic.php?t=5275&start=0
see here: http://board.flatassembler.net/topic.php?t=5275&start=0
Re: cli in fasm (in >fasm<)
and if you have trouble programming the LDT ( when you have to tell the compiler, where the IRQ is) then ask here ( or look at the wiki)
because it can be a little tricky, if the address is above 1 mb ..
KMT dk
because it can be a little tricky, if the address is above 1 mb ..
KMT dk
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
Re: cli in fasm (in >fasm<)
There's absolutely no fun in using other peoples code. Unless you have some valid reason (can't think of one right now), I suggest that you try to code it yourself first.
Break it down. What do you need to have a _very_ basic CLI taking commands?
You need keyboard input. (keyboard driver)
You need a function (using the driver) to read in 1 key
You need some loop that saves the typed characters into a buffer and also prints it to the screen.
Inside the loop you will have to add if statments for stuff like backspace and deal with it.
Inside the loop you'll need to check if the key entered was ENTER and if so call your "check for command" function.
Your check for command function can simply compare the string entered with an array of available commands. If the command wasn't found, print error + new prompt and go back to the loop. If the command was found somewhere in the array of available commands you can have another array with the addresses of the function to call. For example if it was command 3, jump to the address on location 3 in the function adress array.
This is basically what i do in assembly to get my CLI working.
Break it down. What do you need to have a _very_ basic CLI taking commands?
You need keyboard input. (keyboard driver)
You need a function (using the driver) to read in 1 key
You need some loop that saves the typed characters into a buffer and also prints it to the screen.
Inside the loop you will have to add if statments for stuff like backspace and deal with it.
Inside the loop you'll need to check if the key entered was ENTER and if so call your "check for command" function.
Your check for command function can simply compare the string entered with an array of available commands. If the command wasn't found, print error + new prompt and go back to the loop. If the command was found somewhere in the array of available commands you can have another array with the addresses of the function to call. For example if it was command 3, jump to the address on location 3 in the function adress array.
This is basically what i do in assembly to get my CLI working.