Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
kwatman

how to read input when making a custom os ?

Question

hello everyone, im trying to write my own custom operating system. so far everything is working, i can print things to the screen etc. I mostly learn how to do things by looking at the source code of of openOS. but one thing i cant figure out is how i can read user input. im currently writing a terminal but how do i read the keyboard and mouse input. i don't see the keyboard in the components section of the site and i don't understand the implementation in openOS. can someone help me with this ?

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
On 12/24/2021 at 9:53 PM, mattia said:

For read the user input you must use io.read().

Read the io guide Input and Output Facilities for more details.

I dont think the io library is avaliable when writing your own operating system based of https://ocdoc.cil.li/tutorial:custom_oses 
 

I suspect you will need to create your own implementation that looks at keyboard and mouse events using computer.pullSignal().

I'd recommend creating your own implementation of the event library before you really worry about user input. I havent really gotten far enough into the development of my own OS to really help you through experience here but thats my speculation at least

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.