Cosmos icon indicating copy to clipboard operation
Cosmos copied to clipboard

Wrong key maping while booted from USB on old laptop

Open bumboo001 opened this issue 3 years ago • 26 comments

Area of Cosmos - What area of Cosmos are we dealing with?

When I'm booted from bootable usb made with rufus on old laptop (Elitebook2530p)

Expected Behaviour - What do you think that should happen?

When I press for example A it writes A not enter

Actual Behaviour - What unexpectedly happens?

When I press A os recive enter not A and if I press other key os don't do nothink

Reproduction - How did you get this error to appear?

When I create bootable USB with rufus.A is enter but other keys does nothing at most cases. I tried it on my old laptop HP elitebook 2530p. I tried it on far better computer and on it works fine what to do? has cosmos some minimum requiments to run on some device? I tried virtualbox because my old pc can't run vmware and keys was fine.

Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?

User Kit

bumboo001 avatar Feb 01 '22 08:02 bumboo001

If you can try adding an external PS/2 keyboard and test it like so.

ghost avatar Feb 01 '22 08:02 ghost

Hello BlitzWolfMatthew I haven't PS/2 keyboard or port on laptop But I have this problem on every "old" laptop. On new laptops it works ok

bumboo001 avatar Feb 01 '22 09:02 bumboo001

So I tested to run example when I create new csharp cosmos project on 3 HP laptops and on 1 dell precision On every HP laptop "cosmos OS" don't works On dell precision laptop works with no problems

bumboo001 avatar Feb 01 '22 09:02 bumboo001

Maybe your keyboard doesn't support PS/2 or doesn't use PS/2. I really wish Cosmos supported USB

Dell-Optiplex-390 avatar Feb 01 '22 10:02 Dell-Optiplex-390

How wrong is the key mapping? Is it just the difference of a few keys or is pressing A mapped to Enter for example?

quajak avatar Feb 04 '22 17:02 quajak

How wrong is the key mapping? Is it just the difference of a few keys or is pressing A mapped to Enter for example?

You can't write anything. First only few keys(around 3 to 6) respond to press and they are mapped to totally other characters such as £] <... After few presses only responds "A" and is mapped to enter but when I press "a" (enter) it responds twice(like double enter)

I found that more keys are mapped to dot(.)

bumboo001 avatar Feb 04 '22 20:02 bumboo001

Sounds like a duplicate of https://github.com/CosmosOS/Cosmos/issues/1801 . Could you get the information i requested in the other issue?

quajak avatar Feb 04 '22 21:02 quajak

Yes, there they are

What keys are being mapped incorrectly? All are wrong(A is enter and most of other keys are maped to. /[...)

I am assuming this is on real hardware? Is the keyboard an actual ps/2 keyboard?

Real hardware i'm booted from USB on real hardware. And I'm using laptop integrated keyboard

bumboo001 avatar Feb 05 '22 13:02 bumboo001

I mean can you do what I requested in https://github.com/CosmosOS/Cosmos/issues/1801#issuecomment-856101567 ?

quajak avatar Feb 05 '22 15:02 quajak

I mean can you do what I requested in #1801 (comment) ?

I'ill try tomorrow thanks

bumboo001 avatar Feb 05 '22 16:02 bumboo001

I mean can you do what I requested in #1801 (comment) ?

Hello I tried that but I have user kit and I can't edit that file. So when I put that code (Console.WriteLine("(PS/2 Keyboard) Current scan code set: " + GetScanCodeSet());) in the BeforeRun() in the main file of kernel i've got error: Error CS0103 The name 'GetScanCodeSet' does not exist in the current context

what to do?

bumboo001 avatar Feb 06 '22 19:02 bumboo001

The easiest would be to install the devkit.

If that is not an option, you can copy the code from https://github.com/CosmosOS/Cosmos/blob/6638f8e357951e930d78f99e1daa3f8e2a789f9b/source/Cosmos.HAL2/PS2Keyboard.cs#L93 and create your own local version of the method. You will need the value from to Global.PS2Controller. Hopefully you can call your local version and it would work.

quajak avatar Feb 06 '22 21:02 quajak

The easiest would be to install the devkit.

If that is not an option, you can copy the code from

https://github.com/CosmosOS/Cosmos/blob/6638f8e357951e930d78f99e1daa3f8e2a789f9b/source/Cosmos.HAL2/PS2Keyboard.cs#L93 and create your own local version of the method. You will need the value from to Global.PS2Controller. Hopefully you can call your local version and it would work.

Hello I'm doing somethink wrong or I can't call local version PS2keyboard

But when I call only initialize methodni can found I can't write anithink on input is only writed: "Input: ,

bumboo001 avatar Feb 10 '22 09:02 bumboo001

Can you post your code?

quajak avatar Feb 10 '22 15:02 quajak

Sure, here is entire solution made in visual studio 2019 keyboardTest1.zip

Can you post your code?

bumboo001 avatar Feb 10 '22 15:02 bumboo001

Change the namespace of your version, so that you can address it.

quajak avatar Feb 12 '22 13:02 quajak

Can you make video how to do that because I don't know how...

Thanks

bumboo001 avatar Feb 12 '22 16:02 bumboo001

change line 8 from namespace Cosmos.HAL to namespace keyboardTest1

quajak avatar Feb 15 '22 16:02 quajak

change line 8 from namespace Cosmos.HAL to namespace keyboardTest1

done but i've got 9 errors: image

bumboo001 avatar Feb 15 '22 16:02 bumboo001

add using Cosmos.HAL; at the beginning of the file.

quajak avatar Feb 15 '22 16:02 quajak

@quajak

add using Cosmos.HAL; at the beginning of the file.

6 errors image maybe I could create custom classtype (I don't know correct name) named it like abc and add there own initialize method so i can call it from main script. I think that i must define every global and core object with Cosmos.core because cosmos.hal has same

UPDATE: just one error: i fixed wrong references between core and hal image

UPDATE: 0 errors that was for cosmos.hal

bumboo001 avatar Feb 15 '22 16:02 bumboo001

What's the result when you let it run?

quajak avatar Feb 15 '22 17:02 quajak

Do this to Initialize keyboard keyboardinitialize

GeorgeFence avatar Jun 01 '22 19:06 GeorgeFence

Do this to Initialize keyboard keyboardinitialize

So i need to remove lines above red lines?

bumboo001 avatar Jun 01 '22 19:06 bumboo001

write what is red underlined :) - but NASM exiting with code 1 (if you have PS2Keyboard and KeyboardBase files)  :( ---------- Původní e-mail ---------- Od: bumboo001 @.> Komu: CosmosOS/Cosmos @.> Datum: 1. 6. 2022 21:31:22 Předmět: Re: [CosmosOS/Cosmos] Wrong key maping while booted from USB on old laptop (Issue #2079) "

" Do this to Initialize keyboard keyboardinitialize (https://user-images.githubusercontent.com/105986123/171485198-17d0ee7a-b792-4f77-b18b-2d874e4be6e9.jpg) " So i need to remove lines above red lines?

— Reply to this email directly, view it on GitHub (https://github.com/CosmosOS/Cosmos/issues/2079#issuecomment-1144050361), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AZITQS2ZTGJXV64YVZI3D3TVM63AHANCNFSM5NIORM7Q) . You are receiving this because you commented. Message ID: <CosmosOS/Cosmos/ @.***> "

GeorgeFence avatar Jun 03 '22 12:06 GeorgeFence

What is the nasm error?

quajak avatar Jun 03 '22 14:06 quajak