FreeDOS 21st century?

DOS specific questions.
dasyar
Posts: 363
Joined: Dec 04, 2008 15:31

FreeDOS 21st century?

Postby dasyar » Feb 14, 2019 17:06

As I was doing some electronics clean up I came across a couple of items that maybe could work with FreeDOS. That led me to go to the FreeDOS site, where I noticed they just released FreeDOS 1.3 RC1, that got me curious. I also noticed some coverage of something called the NightKernel, more curiosity.

So, I installed the FreeDOS 1.3 RC1, wow, what difference since the last time I tried a FreeDOS install. They now also have a live disk install, which works very well, but lacks a couple of things. One item, if you are using the live edition, it would be nice if you could save or copy some things to the media that you are using. This would be especially nice if they had a USB live edition version, but the USB install still has some problems.

As for the NightKernel, there are some developers that produced a 32 bit version/replacement for the FreeDOS kernel.sys. At the moment the NightKernel does not run any applications, so it never got included in the FreeDOS 1.3 release. The two things that I got out of the NightKernel were, works in protected mode 32 bit, and will have some kind of task switching code. This is task switching and not multitasking, I think. If it is multitasking then that would be a big step for FreeDOS.

Now, what does this have to do with freeBASIC, what could you do with freeBASIC, if it were running in a 1GB RAM environment? What sort of programs could you come up with using task switching/multitasking? And yes I have a machine setup with FreeDOS 1.3 plus I also installed freeBASIC. I am in the process of compiling one of my NewTerm programs, connect two of the FreeDOS units, just to see how well that works out. Not sure where this will take me.
marcov
Posts: 2767
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: FreeDOS 21st century?

Postby marcov » Feb 14, 2019 18:09

dasyar wrote:Now, what does this have to do with freeBASIC, what could you do with freeBASIC, if it were running in a 1GB RAM environment? What sort of programs could you come up with using task switching/multitasking?


The same applications as people have being making with real 21th century systems for decades now ?

In these kind of messages there is always so much hope, but after 40 years of dos, there should be more than hope to show for.
dasyar
Posts: 363
Joined: Dec 04, 2008 15:31

Re: FreeDOS 21st century?

Postby dasyar » Feb 14, 2019 23:04

In these kind of messages there is always so much hope, but after 40 years of dos, there should be more than hope to show for.

Yea, I totally agree, but it is what it is. What would I like to see? Maybe a freeDOS kernel that has multitasking and of course 32 bit protected mode. Have the kernel be able to start up any kind of .com/.exe, to replace the command.com program, when necessary. If it is going to support task switching/multitasking, then it will need to have some new commands, in order to use it. When I looked at the NightKernel asm code I did not see any code that was supporting that, so I do not know how they will be handling that aspect.

I went ahead and found a DB-9 rs-232 cable and connected up the two computers, and low and behold my NewTerm terminal program worked. So, the FBC Com support was functioning at 115200 baud, as expected. The only thing that I found unusual is when I used screen 20, the mouse cursor appears on the screen. Not sure if that is a DOS thing, I thought you had to use the mouse code to get a mouse cursor and functioning buttons.

Since the FreeDOS supports the screen 20, I might have to code the program so it is in some nice looking graphics. Maybe try to figure out how to do some widgets, and that sort of thing, if that is possible. Oh maybe add some kind of file transfer code, I wonder if anybody has some FBC file transfer code available?
dasyar
Posts: 363
Joined: Dec 04, 2008 15:31

Re: FreeDOS 21st century?

Postby dasyar » Feb 17, 2019 21:37

Just to see how FreeDOS handles GUI, I created the program below. A couple of things I did notice with the FBC DOS version, only 16 colors to work with? The other thing is, for some reason the "time' display does not look right, not sure how to fix that. I am sure that there are other things that I have not yet run into, that I would normally expect I could use.

I did a quick search on how TSR works in DOS, in this version of FreeDOS, not sure if that would be a great improvement to be using it. This makes me wonder, when the NightKernel becomes fully functional, if the proposed task switching will make FreeDOS that more attractive to use. Still up in the air about how far I will be going with this.

Code: Select all

' NewTerm.bas
' Feb 16, 2019
'
Screen 20 '1024,768
color 7,1:cls 'Paints BG blue-1, FG white-7
line (0,0)-(1023,767),4,b  ' Outline the screen red border.

Dim Shared as Long mx,my,mb
Dim As String Key,inBuff
Dim Shared t As double
Dim Shared As Integer  column,row,flag,newplace

Declare Sub TextCursor()

Type BUTTON
  As String title
  As Integer x
  As Integer y
  As Integer w
  As Integer h
  As ulong c1
  As ulong c2
  As Integer a
End Type

Sub drawTitle()
  Line (2,2)-(1022,24),8,bf
  Draw String (450,5),"NewTerm",3
End Sub

Sub drawButton(btn as BUTTON)
  Line (btn.x,btn.y)-(btn.x+btn.w,btn.y + 24),3,bf  'Box
  Line (btn.x,btn.y)-(btn.x+btn.w,btn.y + 24),0,b   'Box outline 16
  Draw String (btn.x+4,btn.y+4),btn.title,btn.c1
End Sub

Dim Shared As BUTTON btnQuit

' Quit button
btnQuit.x = 4  '0
btnQuit.y = 26  '0
btnQuit.w = 8 * 5
btnQuit.h = 16 * 8  '8
btnQuit.title = "Quit"
btnQuit.c2 = 0  ' ??Grey-8
btnQuit.c1 = 0  ' White

drawTitle()
drawButton(btnQuit)

locate 5,2
' Open COM port.
Open COM "COM1:115200,n,8,1,cs0,ds0,cd0,rs" As #1
' Test if available.
If Err <> 0 Then
  Print "Error opening Com Port."
Else
  Print "COM1 Port Open! 115200 BAUD    ";
  Print date
  locate 7,1
End If
view print 6 to 40
Line (0,78)-(628,640),11,b

Draw String (650,50),"* This works with FreeDOS 1.3 RC1.",7
Draw String (650,65),"* 'Quit' or 'Esc' to close the program.",7
Draw String (650,80),"* A very simple terminal program. Just",7
Draw String (650,95),"  to see what it looks like in FreeDOS.",7
Draw String (650,110),"* Uses 1024x768, COM1, 115200 BAUD.",7
Draw String (650,125),"* If mouse attached, use 'Quit'. If",7
Draw String (650,140),"  no mouse, use 'Esc' key.",7

Do
' Start mouse control.
getmouse mx,my,,mb

' Terminal screen
  Key = Inkey
  Draw String (4,750),time,7  ' Not working as expected
  TextCursor()

  If Key = Chr(27) Then
    Exit Do
  End If
  If Key <> "" Then
    If Key = Chr(13) Then
      Print #1, Chr(13)     
      Print Chr(13)
    Else
      Print #1, Key;
      Print Key;
    End If
  End If
  While Loc(1) > 0
    inBuff = Input(Loc(1),#1)
    Print inBuff;
  Wend

' Mouse reaction.
  If mb = 1 Then
' This is the quit button.
    If mx>btnQuit.x And mx<btnQuit.x+btnQuit.w And my>btnQuit.y And my<btnQuit.y+16 Then
      End
    End If

' Mouse event.
    While mb = 1
      getmouse mx,my,,mb
    Wend
  End If
Sleep 1,0
Loop

Close
Cls
End

Sub TextCursor()
column = Pos
row = CsrLin

If timer-t>.5 Then
  flag=Not(flag)
  If flag Then
    print "_";
  Else
    print " ";
  End If
  locate row,column
  t=timer
' Adjust cursor postion.
  If column >= 78 Then
    Print chr(13)
  End If
End If
End Sub
counting_pine
Site Admin
Posts: 6172
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: FreeDOS 21st century?

Postby counting_pine » Feb 17, 2019 22:26

dasyar wrote:Just to see how FreeDOS handles GUI, I created the program below. A couple of things I did notice with the FBC DOS version, only 16 colors to work with? The other thing is, for some reason the "time' display does not look right, not sure how to fix that. I am sure that there are other things that I have not yet run into, that I would normally expect I could use.

Screen 20 should support up to 256 colours. If not, maybe try ScreenRes, which lets you choose the bit depth (8/16/32 bpp, I think). 8-bit should provide a full 256-colour palette (although I think the last 8 or so colours are black).

Draw String is transparent, so when drawing changeable text, the new text will overlap with the old. You'll need to wipe the area first, e.g. with a filled box ('Line (x1,y1)-step(x2,y2),c, bf').
dasyar
Posts: 363
Joined: Dec 04, 2008 15:31

Re: FreeDOS 21st century?

Postby dasyar » Feb 18, 2019 13:27

...8-bit should provide a full 256-colour palette (although I think the last 8 or so colours are black).

Does anybody have a chart listing for the color palette that FBC supports? I have the standard listing of 0 - 15, with zero being black, and …, etc. Since it seems that FreeDOS and FBC handle colors very well, it might be of some benefit to all if there was some kind of chart, maybe, available, of the colors that FBC does in fact support?

Thanks
counting_pine
Site Admin
Posts: 6172
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: FreeDOS 21st century?

Postby counting_pine » Feb 18, 2019 13:58

The wiki has got you covered: /wiki/GfxDefPalettes
The palette can be changed to whatever you like though, with e.g. Palette i, r, g, b.
caseih
Posts: 1374
Joined: Feb 26, 2007 5:32

Re: FreeDOS 21st century?

Postby caseih » Feb 18, 2019 15:41

There was some discussion of TSRs and FB on the forum last year sometime. You might use search to pull up that discussion. I'm pretty sure that FBC under DOS, and the executables it creates are 32-bit extended-mode programs, so they can't run on 16-bit chips like the 80286 or the 8086. Also I don't think you can make 32-bit TSRs in MS-DOS.
dasyar
Posts: 363
Joined: Dec 04, 2008 15:31

Re: FreeDOS 21st century?

Postby dasyar » Feb 18, 2019 16:22

I am more interested in FreeDOS and FBC, if I have a copy of MS-DOS, I have not used it in a very long time.

I just noticed a new version of FBC is available, and I also noticed that it has some "experimental" multithreading for DOS. Now, I am wondering if that could be used in a manner that resembles a TSR?. I am not sure as to who created the multithreading for DOS code, maybe a deeper explanation as to how or what it would be used for, in terms of FreeDOS, would be applicable.

Some thoughts about multithreading for DOS :
Could a "&" be created for doing background jobs.
How would it work in a graphics application, in terms of running more than one graphics app, in the same application.
Just a few thoughts.
caseih
Posts: 1374
Joined: Feb 26, 2007 5:32

Re: FreeDOS 21st century?

Postby caseih » Feb 18, 2019 18:02

dasyar wrote:I am more interested in FreeDOS and FBC, if I have a copy of MS-DOS, I have not used it in a very long time.
Such a distinction doesn't matter. FreeDOS is nearly 100% compatible with MS-DOS, and shares all the same architecture and limitations as plain old DOS. Hence my comment about TSRs and the 32-bit code that FBC for DOS produces. The limitations of FBC on MS-DOS apply to FreeDOS. As far as FBC is concerned, it's the same operating system.

NightKernel looks interesting. Not sure what the use case for it is, or how they intend to expose their features to programs. But it is fun for the developers, so that's all the reason they need.
I just noticed a new version of FBC is available, and I also noticed that it has some "experimental" multithreading for DOS. Now, I am wondering if that could be used in a manner that resembles a TSR?. I am not sure as to who created the multithreading for DOS code, maybe a deeper explanation as to how or what it would be used for, in terms of FreeDOS, would be applicable.
I believe it's probably using the the DJGPP port of FSU pthreads that was talked about at https://groups.google.com/forum/#!topic ... NeA2ZUAhmI, or the older GNU pthreads DJGPP libary. These are libraries that emulate threads within a single process. Some implementations use interrupts, others used a cooperative model of thread switching (similar to how Windows 3.x did things) where a function call would give up the time slice.
Some thoughts about multithreading for DOS :
Could a "&" be created for doing background jobs.
How would it work in a graphics application, in terms of running more than one graphics app, in the same application.Just a few thoughts.
No this threading support would not allow you to do "background" jobs outside of your running program in the sense of a continuously running TSR. But it would let you do more than one thread within your program. If you use the FB runtime's screen locking functions, then yes multiple threads should be able to talk to the graphics library. Threads in FB on DOS would not rely on any OS support to do the multitasking.
counting_pine
Site Admin
Posts: 6172
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: FreeDOS 21st century?

Postby counting_pine » Feb 26, 2019 13:14

I've split your UEFI question off into viewtopic.php?f=4&t=27466. It warrants its own thread.
(EDIT: I split off your other question too: viewtopic.php?f=4&t=27467)
dasyar
Posts: 363
Joined: Dec 04, 2008 15:31

Re: FreeDOS 21st century?

Postby dasyar » Mar 31, 2019 17:01

FreeDOS/xxxDOS, 21st century, to little too late. After viewing some of the threads and posts here, it is a lost cause, for FreeDOS/xxxDOS.

Even if the Knight kernel becomes available, in the near future, it will not help to overcome the UEFI wave. The companies that are selling the PC desktops will make sure that all the PCs have a pure UEFI. So, I was thinking maybe you could build your own desktop. I checked some of the motherboards that are being produced, no mention of legacy BIOS, just the UEFI is available. If there is a legacy BIOS motherboard that is now available, I bet that it would disappear very shortly.

What is in the future, more complex and mega-large OS programs, yes, that includes Linux along with Windows. And where does FreeBasic fit in this scenario?
dasyar
Posts: 363
Joined: Dec 04, 2008 15:31

Re: FreeDOS 21st century?

Postby dasyar » Apr 13, 2019 19:24

Not sure if anybody is following the Night Kernel development, but, the latest information, is they have implemented some working multitasking code. I did not notice what the status of the 32 bit environment is. I am glad to see that they do have some code development going on at a somewhat consistent rate. Who knows, maybe with the next couple of months they will have a Night Kernel sys at beta level for testing available.
angros47
Posts: 1514
Joined: Jun 21, 2005 19:04

Re: FreeDOS 21st century?

Postby angros47 » Apr 16, 2019 16:58

caseih wrote:There was some discussion of TSRs and FB on the forum last year sometime. You might use search to pull up that discussion. I'm pretty sure that FBC under DOS, and the executables it creates are 32-bit extended-mode programs, so they can't run on 16-bit chips like the 80286 or the 8086. Also I don't think you can make 32-bit TSRs in MS-DOS.


That was the discussion you mentioned:
https://freebasic.net/forum/viewtopic.php?f=4&t=26883&p=249986

And I confirm that FBC and its executables are 32 bit programs so at least an 80386 processor is required. For lesser processor you should use QB, PowerBasic or whatever (PowerBasic for DOS was freely available, last time I checked, but you have to mail the owner to get a copy)
caseih
Posts: 1374
Joined: Feb 26, 2007 5:32

Re: FreeDOS 21st century?

Postby caseih » Apr 17, 2019 4:45

dasyar wrote:What is in the future, more complex and mega-large OS programs, yes, that includes Linux along with Windows. And where does FreeBasic fit in this scenario?
FB is already fairly successful on Windows and Linux, so I really don't see much changing as far as that goes. Sure things are more complex now but on the other hand, programming as an endeavor has never been more accessible and we've never had more powerful and expressive tools and languages than we do today. And on the other end of the spectrum we have embedded SoCs that are really fun to work with and neat environments like Arduino. I'm mostly happy with where things are today, and satisfied with the tools I have as a programmer.

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 1 guest