|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
ccylkro
Joined: 15 Oct 2007 Posts: 4
|
Posted: Tue Oct 16, 2007 7:38 am Post subject: Application with dbos on XP |
|
|
Hello,
I am a student in a university in Switzerland, currently I work on a semester project which is a application from the nineties. The application was compiled with ftn77 and uses dbos. It runs only on win 95 and win 98. My job is it, to recompile this application that it works on a newer windows like xp.
Is it possible to use still dbos? by what can dbos be replaced? or what is the easiest way to run this application on win xp?
best regards |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Tue Oct 16, 2007 9:00 am Post subject: |
|
|
Hello,
DBOS is history, you can forget it ! It's purpose was to allow ftn77 applications to address expanded memory beyond the 640 kilobyte limit of the 16bit processors of early PC's. It was an excellent product at the time and worked very well. But now, with 32bit (or Win32) machines it is no longer necessary. Just simply re-compile your source code with the latest ftn95 compiler. There is no real reason for it not to work, unless the original source code included some of the ftn77 code extensions (like graphics), but even then most of these have been ported to ftn95, and only a little work may be necessary to correct any problems. |
|
Back to top |
|
|
ccylkro
Joined: 15 Oct 2007 Posts: 4
|
Posted: Tue Oct 16, 2007 4:44 pm Post subject: |
|
|
hello john,
thanks a lot for your prompt response. i will try to compile it with the ftn95.
i will post again when it don't work.
regards |
|
Back to top |
|
|
ccylkro
Joined: 15 Oct 2007 Posts: 4
|
Posted: Sun Nov 11, 2007 11:02 am Post subject: graphical library of DBOS |
|
|
hello john,
I tried to re-compile the source code with the latest ftn95 compiler, but I have some errors that are bounded to the graphical library. So the next step I would like to do is to replace the graphical library. Do you now maybe an “open source“ library, that I could also modify, or a similar library that includes this functions:
screen_type() (graphics.h)
graphics_mode_set() (graphics.h)
text_mode() (graphics.h)
draw_line() (graphics.h)
draw_text() (graphics.h)
clear_screen_area() (graphics.h)
graphics_write_mode() (graphics.h)
get_high_res() (graphics.h)
attach() (lib.h)
get_printer_status()(lib.h)
best regards |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 445 Location: Manchester
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sun Nov 11, 2007 3:49 pm Post subject: |
|
|
The first stage in converting from FTN77 & DBOS era graphics to FTN95 is to accept that you are going to need to create a Windows application. This can be as primitive or as full-featured as you like. You can do it using .NET or the older ClearWin approach. I use ClearWin.
There used to be a demo program named PLOT.FOR distributed with FTN77+clearwin. This became PLOT.F90 and seems to have disappeared from the demos distributed with FTN95.
Basically, you open a window with Clearwin. In this window, you create a graphics region. It used to be done with the %dw code (the example is in PLOT.FOR), but the newer %gr is better (PLOT.F90 uses this). You need to tell windows that you want RGB graphics mode. The, you use the standard library graphics routines provided in FTN95 to draw into the graphics area. You will find direct replacements for every library subroutine in the old graphics library - some of them are even the same name.
When it comes to printing your colour graphic, the simplest way is to get a screen dump and print that. The next simplest way is to open a windows printer and redraw the graphic. The graphics areas on the screen and printer obviously have different sizes, so that you need to interrogate any new "device" for its size before you begin drawing. You switch between devices such as a graphics area on the screen or a printer by means of an integer number called a "handle" - every windows object, be it a menu item, "button", graphics area etc has its own unique handle.
Here's my version of PLOT with printing built in ...
OPTIONS (INTL)
WINAPP
PROGRAM PLOT
IMPLICIT NONE
INCLUDE <WINDOWS.INS> ! you can USE CLRWIN instead
! Remember to declare your call-back functions EXTERNAL
INTEGER*4, EXTERNAL :: ABOUT_FUNCTION,PLOT_FUNCTION,CLEAR_FUNCTION
INTEGER*4, EXTERNAL :: PRNT_FUNCTION
INTEGER A, ICTRL, iXRES, iYRES, ictrl
COMMON / SCREEN / iXRES, iYRES, ictrl
iXRES=GetSystemMetrics(SM_CXSCREEN)*0.7
iYRES=GetSystemMetrics(SM_CYSCREEN)*0.7
A=WINIO@('%ca[Simple drawing program]&')
A=WINIO@('%mn[&File[E&xit]]&','EXIT')
A=WINIO@('%mn[&Help[&About ClearWin+ PLOT]]&',ABOUT_FUNCTION)
A=WINIO@('%ob%gr[rgb_colours]%cb%lw&',iXRES,iYRES,ictrl)
A=WINIO@('%rj%10^bt[Clear]&',CLEAR_FUNCTION)
A=WINIO@('%2nl%rj%10`^bt[&Plot]&',PLOT_FUNCTION)
A=WINIO@('%2nl%rj%10^bt[Print]&',PRNT_FUNCTION)
A=WINIO@('%2nl%rj%10^bt[E&xit]&','EXIT')
A=WINIO@('%ww[maximise]')
END
INTEGER FUNCTION CLEAR_FUNCTION()
USE CLRWIN ! Salford Clearwin + GUI
IMPLICIT NONE
CALL CLEAR_SCREEN@()
CLEAR_FUNCTION=1
END
INTEGER FUNCTION ABOUT_FUNCTION()
USE CLRWIN
IMPLICIT NONE
INTEGER A
A=WINIO@('%ca[About ClearWin+ PLOT demo program]&')
A=WINIO@('%cnPlot Demo&')
A=WINIO@('%2nl%cn%`7bt[OK]')
ABOUT_FUNCTION=1
END
INTEGER*4 FUNCTION PLOT_FUNCTION()
USE CLRWIN
IMPLICIT NONE
INTEGER A, ICTRL, iXRES, iYRES, ictrl, IX0,IX1, IY0,IY1
COMMON / SCREEN / iXRES, iYRES, ictrl
CHARACTER*20 TITLES(3)
DATA TITLES/'First title ', 'Second title ',
1 'Third title ' /
call DRAW_TEXT@(TITLES(1),iXRES/10,iYRES/10,RGB@(255,0,0))
call DRAW_TEXT@(TITLES(2),2*iXRES/10,2*iYRES/10,RGB@(0,255,0))
call DRAW_TEXT@(TITLES(3),3*iXRES/10,3*iYRES/10,RGB@(0,0,255))
IX0 = iXRES/10; IX1 = iXRES*9/10
IY0 = 5*iYRES/10; IY1 = iYRES*6/10
CALL DRAW_LINE@(IX0,IY0,IX1,IY1,RGB@(0,0,0))
PLOT_FUNCTION=1
END
INTEGER*4 FUNCTION PRNT_FUNCTION()
C implicit integers used in this routine
INCLUDE <WINDOWS.INS>
CHARACTER*20 TITLES(3)
DATA TITLES/'First title ', 'Second title ',
1 'Third title |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sun Nov 11, 2007 3:56 pm Post subject: |
|
|
The message was truncated. Here's the rest:
INTEGER*4 FUNCTION PRNT_FUNCTION()
C implicit integers used in this routine
INCLUDE <WINDOWS.INS>
CHARACTER*20 TITLES(3)
DATA TITLES/'First title ', 'Second title ',
1 'Third title ' /
IA = OPEN_PRINTER@ (jHDC)
CALL SET_CLEARWIN_STRING@(PRINTER_DOCUMENT, 'PLOT graphic')
CALL GET_CURRENT_DC@ (jHDC)
CALL USE_RGB_COLOURS@(0,1)
C CALL USE_RGB_COLOURS@(0,.true.)
C See info on Get Device Caps on MSDN
iXRES = GetDeviceCaps(jHDC, HORZRES)
iYRES = GetDeviceCaps(jHDC, VERTRES)
CALL SELECT_FONT@('Arial')
CALL SIZE_IN_POINTS@(14,7)
call DRAW_TEXT@(TITLES(1),iXRES/10,iYRES/10,RGB@(255,0,0))
call DRAW_TEXT@(TITLES(2),2*iXRES/10,2*iYRES/10,RGB@(0,255,0))
call DRAW_TEXT@(TITLES(3),3*iXRES/10,3*iYRES/10,RGB@(0,0,255))
IX0 = iXRES/10; IX1 = iXRES*9/10
IY0 = 5*iYRES/10; IY1 = iYRES*6/10
CALL DRAW_LINE@(IX0,IY0,IX1,IY1,RGB@(0,0,0))
CALL CLOSE_PRINTER@(JHDC)
! see other options if you want to print more than one page
PRNT_FUNCTION=1
END
Note that I have used both forms (USE CLRWIN and INCLUDE <WINDOWS.INS>) for getting the standard definitions in. CALL SET_CLEARWIN_STRING@ is used to put a proper title in the print queue. The standard font size is fine on the screen, but too small in the hard copy, hence SIZE_IN_POINTS@.
Beware - I use fixed format, and so my continuation markers in column 6 don't show properly here in the forum, and where I have used a C in col 1 for a comment this doesn't show well either.
Regards
Eddie Bromhead |
|
Back to top |
|
|
ccylkro
Joined: 15 Oct 2007 Posts: 4
|
Posted: Tue Nov 20, 2007 1:56 pm Post subject: |
|
|
Hello, at first thanks for your respond.
Because I need an alternative if the compilation failed, I installed Virtual PC, and installed win98 on it, how you said. The win98 runs well, but not dbos.
Anyone knows how I should install dbos on win98 in Virtual PC?
Do I have the correct version of dbos?
Thats the error message:
Microsoft(R) Windows 98
(C)Copyright Microsoft Corp 1981-1999.
C:\WINDOWS>DBOS
[DBOS/486 Version 3.12 Copyright (c) Salford Software Ltd 1995]
General protection exception at User/7F983845
In routine _oinit(<ref>struct-ostream_withassign,int) at location +AB
In routine __initialise_cpplib at location +01A1
In routine INITIALISE_SYSTEM@ at location +0546
Trace aborted
Flags=00010202 (GT No carry Even parity DF = forward Co-cw/sw = 037F/0000)
EAX%=786EDD10 EBX%=00000000 ECX%=00000001 EDX%=786EDD04
EBP%=786EDDAC ESI%=786EDC68 EDI%=786EDD10 ESP%=786EDC98
7F983845) INB AL%,DX%
@ LitusSaxonicum: thanks for your code, but at the moment I am not sure what I will exactly do with my application. I have to understand more about the source code that I get of the application before. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7929 Location: Salford, UK
|
Posted: Tue Nov 20, 2007 3:15 pm Post subject: |
|
|
DBOS has been unsupported for many years so we are unable to provide detailed support.
You will need access to an old FTN77 manual otherwise it is difficult to see how you can proceed.
After that you will need to modify the SYSTEM.INI file in order to use the WDBOS.386 virtual device driver. WDBOS.386 is essential if you wish to run DBOS in a DOS box in Windows enhanced mode.
Find the “[386enh]” section in your SYSTEM.INI. On a fresh line, after the last “device=” directive, enter:
device=c:\dbos.dir\wdbos.386
or its equivalent depending on where wdbos.386 is located. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|