Fiwix 0.9.0

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
User avatar
Mikaku
Member
Member
Posts: 42
Joined: Sat Jun 25, 2016 8:29 am
Libera.chat IRC: Mikaku
Location: Catalonia
Contact:

Re: Fiwix 0.9.0

Post by Mikaku »

Octocontrabass wrote:It doesn't hang anymore, but it still does something that makes the keyboard completely unresponsive until the BIOS resets it. Since the keyboard is unresponsive, I can't do anything after the OS boots. The same keyboard on the other 386 has no issues.
Good to know that it no longer hangs on boot, but still worried that the keyboard gets unresponsive after a complete boot. I've never experienced that problem in all PCs where I tested Fiwix. Perhaps this is just an incompatible feature in that specific PC.
Octocontrabass wrote:On both machines, I see floppy disk seek errors near the end of boot. This doesn't happen in Bochs, so it might just be a problem with the disk I'm using.
Yeah, that looks like a problem in the diskette.
User avatar
Mikaku
Member
Member
Posts: 42
Joined: Sat Jun 25, 2016 8:29 am
Libera.chat IRC: Mikaku
Location: Catalonia
Contact:

Re: Fiwix 0.9.0

Post by Mikaku »

zaval wrote:i think it's just a taste and personal preference. if it was driven by the logic, the first ultimate FS to choose for this kind of stuff, would be ... the FAT family of course! it's interoperable AF, it's simple, it's fast, it's easy to implement. For every intelligent being in the whole Universe. not only for the weird "unix" world. :mrgreen:
Well ... you know, the FAT filesystem was not a choice, it is not suitable for UNIX-like operating systems. Looks like a toy. :wink:
User avatar
zaval
Member
Member
Posts: 654
Joined: Fri Feb 17, 2017 4:01 pm
Location: Ukraine, Bachmut
Contact:

Re: Fiwix 0.9.0

Post by zaval »

Mikaku wrote: Well ... you know, the FAT filesystem was not a choice, it is not suitable for UNIX-like operating systems. Looks like a toy. :wink:
ah. so you have chosen a "suitable" FS with "maximum size of each filesystem is 64MB". doesn't look like a toy. this must be that famous "unix philosophy".
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
User avatar
Mikaku
Member
Member
Posts: 42
Joined: Sat Jun 25, 2016 8:29 am
Libera.chat IRC: Mikaku
Location: Catalonia
Contact:

Re: Fiwix 0.9.0

Post by Mikaku »

zaval wrote:ah. so you have chosen a "suitable" FS with "maximum size of each filesystem is 64MB". doesn't look like a toy. this must be that famous "unix philosophy".
No, as I said, the decision was to have a simple and UNIX-like filesystem. This is a double requirement. FAT is only simple, not UNIX-like. And also, the Minix FS is just temporary, this permits me to advance the kernel quickly. Then, as I also said, the EXT2 FS will be probably implemented to have more space in the FS.
Octocontrabass
Member
Member
Posts: 5494
Joined: Mon Mar 25, 2013 7:01 pm

Re: Fiwix 0.9.0

Post by Octocontrabass »

Mikaku wrote:Good to know that it no longer hangs on boot, but still worried that the keyboard gets unresponsive after a complete boot. I've never experienced that problem in all PCs where I tested Fiwix. Perhaps this is just an incompatible feature in that specific PC.
I was able to make the original kernel work by patching your keyboard_wait() function, so I don't think it's a problem with the hardware. From what I saw when I was creating that patch, your code to communicate with the keyboard has some issues. For example, you try to send and receive a lot of data through the keyboard controller without making sure it's ready. (Only your IRQ handler can do that, since the IRQ indicates that the keyboard controller is ready for you to read some data.)
User avatar
zaval
Member
Member
Posts: 654
Joined: Fri Feb 17, 2017 4:01 pm
Location: Ukraine, Bachmut
Contact:

Re: Fiwix 0.9.0

Post by zaval »

Mikaku wrote: No, as I said, the decision was to have a simple and UNIX-like filesystem. This is a double requirement. FAT is only simple, not UNIX-like. And also, the Minix FS is just temporary, this permits me to advance the kernel quickly. Then, as I also said, the EXT2 FS will be probably implemented to have more space in the FS.
okay. the only question, just of curiosity, don't you think that a FS should not give a sh!t what your OS is "like"? I mean isn't it stupid to confer an entity with attributes which aren't (shouldn't) even closely be relevant to it? what's a "unix-like" FS? Or whatever-like FS? Is this a design which is impossible to reproduce on a non-whatever-like system? Is it where the design and implemenation are twisted into incomprehensible spagetti, where non-FS concepts are unnecessarily pulled into a FS? If so, then it's a garbage-like design. imho.
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
User avatar
Mikaku
Member
Member
Posts: 42
Joined: Sat Jun 25, 2016 8:29 am
Libera.chat IRC: Mikaku
Location: Catalonia
Contact:

Re: Fiwix 0.9.0

Post by Mikaku »

Octocontrabass wrote:I was able to make the original kernel work by patching your keyboard_wait() function, so I don't think it's a problem with the hardware. From what I saw when I was creating that patch, your code to communicate with the keyboard has some issues. For example, you try to send and receive a lot of data through the keyboard controller without making sure it's ready. (Only your IRQ handler can do that, since the IRQ indicates that the keyboard controller is ready for you to read some data.)
I've been working on a complete rewrite of the keyboard reset routine, I've based it on this PDF document: http://caspar.hazymoon.jp/OpenBSD/annex ... 42-KBC.pdf, but it doesn't work neither. It hangs in the most real hardware I have around here. Then, I've included some ideas from Linux and it worked better, but still hangs sometimes.

Do you know of a document with a functional example of a keyboard reset?
User avatar
Mikaku
Member
Member
Posts: 42
Joined: Sat Jun 25, 2016 8:29 am
Libera.chat IRC: Mikaku
Location: Catalonia
Contact:

Re: Fiwix 0.9.0

Post by Mikaku »

zaval wrote:okay. the only question, just of curiosity, don't you think that a FS should not give a sh!t what your OS is "like"? I mean isn't it stupid to confer an entity with attributes which aren't (shouldn't) even closely be relevant to it? what's a "unix-like" FS? Or whatever-like FS? Is this a design which is impossible to reproduce on a non-whatever-like system? Is it where the design and implemenation are twisted into incomprehensible spagetti, where non-FS concepts are unnecessarily pulled into a FS? If so, then it's a garbage-like design. imho.
At user-level you're right, the FS should be transparent enough that the user is not able to distinguish what kind of system is working behind that FS. But the FS is intrinsically bound (at low level) to the kernel, and so it must cooperate in a way that both worlds must understand each other.
User avatar
zaval
Member
Member
Posts: 654
Joined: Fri Feb 17, 2017 4:01 pm
Location: Ukraine, Bachmut
Contact:

Re: Fiwix 0.9.0

Post by zaval »

Mikaku wrote:
zaval wrote:okay. the only question, just of curiosity, don't you think that a FS should not give a sh!t what your OS is "like"? I mean isn't it stupid to confer an entity with attributes which aren't (shouldn't) even closely be relevant to it? what's a "unix-like" FS? Or whatever-like FS? Is this a design which is impossible to reproduce on a non-whatever-like system? Is it where the design and implemenation are twisted into incomprehensible spagetti, where non-FS concepts are unnecessarily pulled into a FS? If so, then it's a garbage-like design. imho.
At user-level you're right, the FS should be transparent enough that the user is not able to distinguish what kind of system is working behind that FS. But the FS is intrinsically bound (at low level) to the kernel, and so it must cooperate in a way that both worlds must understand each other.
see, what you described, in no way implies any esoteric "likeness" of a FS to the OS of the FS implemenation residence. its implementation needs to integrate good with the kernel it belongs to, but not the FS design things. because the only outcome of such a wrong approach is that noone else wants that FS. ;) trust me, the world we live in, is not unix-like.)
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
Octocontrabass
Member
Member
Posts: 5494
Joined: Mon Mar 25, 2013 7:01 pm

Re: Fiwix 0.9.0

Post by Octocontrabass »

Mikaku wrote:Do you know of a document with a functional example of a keyboard reset?
I don't think there's anything wrong with the reset commands you're sending to the keyboard. The problem is how you're using the keyboard controller to send those commands and receive the responses. Before every read from or write to port 0x60, you must read port 0x64 to see if the keyboard controller is ready. Bit 0 is set when you can read from port 0x60. Bit 1 is clear when you can write to port 0x60.

For example, sending a byte to the keyboard should look something like this:

Code: Select all

bool send_to_keyboard( uint8_t byte_to_keyboard )
{
    while( /* timeout */ )
    {
        if( !(inport_b( 0x64 ) & 0x02) )
        {
            outport_b( 0x60, byte_to_keyboard );
            return true;
        }
    }
    return false;
}
And receiving:

Code: Select all

bool receive_from_keyboard( uint8_t * byte_from_keyboard )
{
    while( /* timeout */ )
    {
        if( inport_b( 0x64 ) & 0x01 )
        {
            byte_from_keyboard = inport_b( 0x60 );
            return true;
        }
    }
    return false;
}
Note that the timeout should be based on actual time, not a number of loop repetitions.

Your IRQ handler doesn't have this limitation: the IRQ itself is how the keyboard controller indicates that you may read one byte from port 0x60. I would enable IRQs before trying to reset the keyboard so the IRQ handler could deal with receiving all the responses from the keyboard, but you don't have to do it like that.
stevewoods1986
Member
Member
Posts: 80
Joined: Wed Aug 09, 2017 7:37 am

Re: Fiwix 0.9.0

Post by stevewoods1986 »

Great OS. I will test if you want. It's great to have another Linux around.
You need to port a few GNU packages like Binutils, GCC and Nano. If you add NASM as well, I might be using your OS for my OS :)
Mikaku wrote: I just sent a RESET command (0xFF) and then there was an infinite 'while()' waiting for the byte 0xAA (RESET OK).
Always good to do PS/2 keyboard tests. 0xFF to 0x60. Is your code open source? I would love to contribute.
User avatar
Mikaku
Member
Member
Posts: 42
Joined: Sat Jun 25, 2016 8:29 am
Libera.chat IRC: Mikaku
Location: Catalonia
Contact:

Re: Fiwix 0.9.0

Post by Mikaku »

Octocontrabass wrote:I don't think there's anything wrong with the reset commands you're sending to the keyboard. The problem is how you're using the keyboard controller to send those commands and receive the responses. Before every read from or write to port 0x60, you must read port 0x64 to see if the keyboard controller is ready. Bit 0 is set when you can read from port 0x60. Bit 1 is clear when you can write to port 0x60.
Well, after some days working on the keyboard driver I think that now is doing a stable initialization, at least here with all my old hardware. Bochs, Qemu and VMware Player are always more friendly. :wink:

Thanks for the URLs you gave in your last post. These with that one http://www.flingos.co.uk/docs/reference/PS2-Keyboards/ helped me a lot to improve that driver. Now the kernel even shows a line indicating the keyboard type and the number of PS/2 devices (and supported).

Test the latest patch I uploaded in the Fiwix web site http://www.fiwix.org/fiwix-0.9.0p3.img.gz, and let me know if you still have problems with that old 386 you have there.

Regards.
User avatar
Mikaku
Member
Member
Posts: 42
Joined: Sat Jun 25, 2016 8:29 am
Libera.chat IRC: Mikaku
Location: Catalonia
Contact:

Re: Fiwix 0.9.0

Post by Mikaku »

stevewoods1986 wrote:You need to port a few GNU packages like Binutils, GCC and Nano. If you add NASM as well, I might be using your OS for my OS :)
Yeah, I started porting newlib and I have ported some tools but I realized that it's really hard to compile GNU tools with that library. It's a pity because it was easy to port newlib and I enjoyed a lot doing it, but it lacks a lot of functions. So, now I'm considering a different C library, and musl is a good candidate. :)
stevewoods1986 wrote:Is your code open source? I would love to contribute.
Not right now, but it will be as soon as it reaches 1.0 version (self-hosting).

Thanks for your interest.
Regards.
Octocontrabass
Member
Member
Posts: 5494
Joined: Mon Mar 25, 2013 7:01 pm

Re: Fiwix 0.9.0

Post by Octocontrabass »

Mikaku wrote:Test the latest patch I uploaded in the Fiwix web site http://www.fiwix.org/fiwix-0.9.0p3.img.gz, and let me know if you still have problems with that old 386 you have there.
It works!

It seems like sometimes one of the shift keys gets stuck, and num lock affects keys that it shouldn't, but the keyboard is usable now.
User avatar
Mikaku
Member
Member
Posts: 42
Joined: Sat Jun 25, 2016 8:29 am
Libera.chat IRC: Mikaku
Location: Catalonia
Contact:

Re: Fiwix 0.9.0

Post by Mikaku »

Octocontrabass wrote:It works!

It seems like sometimes one of the shift keys gets stuck, and num lock affects keys that it shouldn't, but the keyboard is usable now.
Great!, that's good news! :)

Yeah, keyboard driver is far from perfect, but if it's usable enough I prefer focusing on other things.
Thanks a lot for your valuable testing and feedback.
Regards!
Post Reply