flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > turbo pascal question

Author
Thread Post new topic Reply to topic
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel
I´m working on a little Operative System with Turbo Pascal 6.0. Twisted Evil

Does anybody know how to execute a program without using exec instruction? Rolling Eyes

Thanks Wink
Post 21 May 2011, 15:42
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 678
Location: Mar del Plata
Enko
arcangel wrote:
I´m working on a little Operative System with Turbo Pascal 6.0. Twisted Evil

Does anybody know how to execute a program without using exec instruction? Rolling Eyes

Thanks Wink

Mh... you cant write an operative sistem using turbo pascal. It always compiles for DOS.
Post 21 May 2011, 15:46
View user's profile Send private message Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel
Enko wrote:
arcangel wrote:
I´m working on a little Operative System with Turbo Pascal 6.0. Twisted Evil

Does anybody know how to execute a program without using exec instruction? Rolling Eyes

Thanks Wink

Mh... you cant write an operative sistem using turbo pascal. It always compiles for DOS.


Thanks for replying Wink

I'm working with "Boot sector that loads and runs COM/EXE programs"http://alexfru.chat.ru/eindex.html

the source code is here

http://alexfru.chat.ru/programming/bootprog.zip

with this I made a tiny turbo pascal kernel and I boot it from a floppy Twisted Evil

but I need that my little operating system runs a program without using exec. Rolling Eyes

I can not use exec because no MS-DOS Embarassed
Post 21 May 2011, 16:14
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
You have to write your own functions that to manage the file system of the disk. Then you have to write .exe loader function, that to read the .exe file from the disk to the memory and to call its entry point. Of course you have to write some memory management functions as well.
Post 22 May 2011, 07:51
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Here is a quick example of what you need to do
Code:
{MZ}
uses dos1, strings;
var
 OLDHANDLER : Procedure;

{$F+}
Procedure int21HANDLER(Flags, CS, IP, AX, BX, CX, DX,SI, DI,
DS, ES, BP: Word); Interrupt;
var
 end_memory,top_memory:integer;
 DriveNumber:byte;
Begin

{read character with echo}
IF HI(AX)=$01 THEN
  BEGIN
    ASM
        XOR AX, AX
        int 16h
        mov ah, 0Eh
        int 10h
    END;
  END;
{write character}
IF HI(AX)=$02 THEN
  BEGIN
     ASM
        mov al, dl
        mov ah, 0Eh
        int 10h
      END;
  END;
 {read character without echo}
IF HI(AX)=$07 THEN
   BEGIN
    ASM
        xor ax, ax
        int 16h
    END;
   END;

{ write string; input ds:dx = string (ended with '$')}

IF HI(AX)=$09 THEN
BEGIN
 ASM                                  { ds:dx points to string}
        mov     si,dx                  { ds:si = string}
        cld
 @print_loop:
        lodsb                          {  get next character}
        cmp     al,'$'                   { is it $ ?}
        je      @done              { if so, we're done}
        mov     ah,0eh               {   function 0eh-print character}
        xor     bx,bx                  {  video page 0}
        int     10h
        jmp     @print_loop
 @done:
        mov    ax,0e0ah
        int    10h
        mov    ax,0e0dh
        int    10h
 END;
END;

{ get current drive}
IF HI(AX)=$19 THEN
 BEGIN
  DriveNumber:=0;
    ASM
        mov al,cs:[DriveNumber]
    END;
 END;
{set interrupt vector}
IF HI(AX)=$25 THEN
BEGIN
  ASM
        cmp al, 19h             { do not allow to change int 19h (for rebooting)}
        je  @int21_error

        cli
        xor ah, ah
        shl ax, 2

        push si
        push bx
        push es

        mov si, ax
        xor bx, bx
        mov es, bx

        mov word ptr es:[si], dx                { offset}
        mov bx, ds
        mov word ptr es:[si+2], bx              { segment}

        pop es
        pop bx
        pop si
        sti

        jmp  @endit

  @int21_error:
        mov ax, 0FFFFh
 @endit:
 END;
END;

{get date
IF HI(AX)=$2A THEN
BEGIN

END;}

{set date
IF HI(AX)=$2B THEN
BEGIN

END;}

{get time
IF HI(AX)=$2C THEN
BEGIN

END;}

{set time
IF HI(AX)=$2D THEN
BEGIN

END;}
{jmp int21_error}

{get dos version}
IF HI(AX)=$30 THEN
BEGIN
    AX:=$3031;
END;

{get interrupt vector}
IF HI(AX)=$35 THEN
BEGIN
  ASM
        push ds
        push si

        xor ah, ah
        shl ax, 2
        mov si, ax

        xor bx, bx
        mov ds, bx

        mov bx, word ptr ds:[si+2]
        push bx
        mov bx, word ptr ds:[si]

        pop es

        pop si
        pop ds

   END;
END;


{alloc ram memory}
IF HI(AX)=$48 THEN
BEGIN
 ASM
        mov ax, es
        shr ax, 2
        inc ax
        shl ax, 2
        mov word ptr [end_memory], ax   {; save (to know free memory)}

        int 12h                         {; get ram size (in KB)}
                                      { ; convert in paragraphs: (*64)}
        shl ax, 6
        mov word ptr [top_memory], ax


        mov ax, word ptr cs:[end_memory]
        add ax, bx
        cmp ax, word ptr cs:[top_memory]
        jg @error
        mov word ptr cs:[top_memory], ax


        mov bx, word ptr cs:[top_memory]        { return in bx free paragraphs}
        sub bx, word ptr cs:[end_memory]
        jmp @endit1
  @error:
        stc
        mov ax, 0FFFFh
  @endit1:
 END;
END;
IF HI(AX)=$4C THEN
BEGIN
  ASM
        push cs
        pop ax
        mov ds, ax
        mov es, ax
        mov ip,0FFFFh
   END;
 END;
END;
{$F-}
procedure ShowText; assembler;
const
   Msg   :PChar =

   'This text is shown using DOS ...INT 21h (09h) $';
asm
   mov  dx,word ptr Msg
   mov  ah,9
   int  21h
end;
procedure WriteChr(Chr: Char);
begin
    asm
     MOV      Al, Chr
     PUSHA
     MOV      Ah, 0Eh
     INT      10h
     POPA
    end;
end;
procedure next_line;
 begin
  asm
  MOV  AH,3
  INT  10h
  MOV  AH,2
  INC  DH
  MOV  DL,0
  INT  10h
 end;
end;
PROCEDURE DOS_VER;
BEGIN
 ASM
  mov  aH, 30h
  int  21h
  mov  bl,ah
  mov  aH,0eh
  int  10h
  mov  ax,0e2eh
  int  10h
  mov  al,bl
  mov  aH,0eh
  int  10h
  END;
END;


procedure WritelnA(Str: String);
var
  Pos: Integer;
  Chr: array[0..254] of Char;
begin
    StrPCopy(Chr, Str);

    for Pos := 0 to (Length(Str) - 1)  do
    begin
         WriteChr(Chr[Pos]);
    end;
    next_line;
end;
procedure WriteA(Str: String);
var
  Pos: Integer;
  Chr: array[0..254] of Char;
begin
    StrPCopy(Chr, Str);

    for Pos := 0 to (Length(Str) - 1)  do
    begin
         WriteChr(Chr[Pos]);
    end;
end;
procedure hold;
begin
   asm
    PUSHA
    XOR AX,AX
    INT 16h
    POPA
   end;
end;

Procedure INSTALL_HANDLER;
begin
GetIntVec($21,@OLDHANDLER);
SetIntVec($21,ADDR(int21HANDLER));
end;
PROCEDURE CLS;
BEGIN
 ASM
     mov AH,2
     mov BH,0
     mov DX,0
     int 16
     mov AH,9
     mov CX,2000
     mov AL,' '
     mov BL,7
     int 16
     mov AH,2
     mov BH,0
     mov DX,0
     int 16
 END;
END;
begin
INSTALL_HANDLER;
writelnA('loading kernel 16 !');
hold;
CLS;
writelnA('hello world!');
hold;
writelnA('DOES INT 21 09h WORK?');
HOLD;
SHOWTEXT;
HOLD;
WriteA('The PAS-DOS Version ');DOS_VER;
NEXT_LINE;
hold;
writelnA('press enter to reboot!');
hold;
end.
    


You need to take the asm code from bootprog for loading exe file and replace the pascal exec rtl with yours.
Heres whats in the pascal rtl EXEC
Code:

        TITLE   EXEC

        LOCALS  @@

DATA    SEGMENT WORD PUBLIC

        EXTRN   DosError:WORD,PrefixSeg:WORD

SaveSP          DW      ?
SaveSS          DW      ?

DATA    ENDS

CODE    SEGMENT BYTE PUBLIC

        ASSUME  CS:CODE,DS:DATA

        PUBLIC  Exec

Exec            PROC    FAR

PathArg         EQU     DWORD PTR [BP+10]
CmdLineArg      EQU     DWORD PTR [BP+6]
FileSeg2        EQU     WORD PTR [BP-2]
FileOfs2        EQU     WORD PTR [BP-4]
FileSeg1        EQU     WORD PTR [BP-6]
FileOfs1        EQU     WORD PTR [BP-8]
CmdLineSeg      EQU     WORD PTR [BP-10]
CmdLineOfs      EQU     WORD PTR [BP-12]
EnvironSeg      EQU     WORD PTR [BP-14]
FileBlock1      EQU     BYTE PTR [BP-30]
FileBlock2      EQU     BYTE PTR [BP-46]
Path            EQU     BYTE PTR [BP-126]
CmdLine         EQU     BYTE PTR [BP-254]

        PUSH    BP
        MOV     BP,SP
        MOV     SaveSP,SP
        MOV     SaveSS,SS
        SUB     SP,254
        MOV     DS,PrefixSeg
        MOV     AX,WORD PTR DS:2CH
        MOV     EnvironSeg,AX
        PUSH    SS
        POP     ES
        CLD
        LDS     SI,PathArg
        LEA     DI,Path
        LODSB
        CMP     AL,79
        JB      @@1
        MOV     AL,79
@@1:    CBW
        XCHG    AX,CX
        REP     MOVSB
        XOR     AL,AL
        STOSB
        LDS     SI,CmdLineArg
        LEA     DI,CmdLine
        LODSB
        CMP     AL,126
        JB      @@2
        MOV     AL,126
@@2:    STOSB
        CBW
        XCHG    AX,CX
        REP     MOVSB
        MOV     AL,0DH
        STOSB
        PUSH    SS
        POP     DS
        LEA     SI,CmdLine
        MOV     CmdLineOfs,SI
        MOV     CmdLineSeg,DS
        INC     SI
        LEA     DI,FileBlock1
        MOV     FileOfs1,DI
        MOV     FileSeg1,ES
        MOV     AX,2901H
        INT     21H
        LEA     DI,FileBlock2
        MOV     FileOfs2,DI
        MOV     FileSeg2,ES
        MOV     AX,2901H
        INT     21H
        LEA     DX,Path
        LEA     BX,EnvironSeg
        MOV     AX,4B00H
        INT     21H
        JC      @@3
        XOR     AX,AX
@@3:    MOV     DX,SEG DATA
        MOV     DS,DX
        CLI
        MOV     SP,SaveSP
        MOV     SS,SaveSS
        STI
        MOV     DosError,AX
        POP     BP
        RET     8

Exec            ENDP

        PUBLIC  DosExitCode

DosExitCode     PROC    FAR

        MOV     AH,4DH
        INT     21H
        RET

DosExitCode     ENDP

CODE    ENDS

        END
    


NOTE: There is another way you can do it, take a look at minidos it use bootprog for a loader and as bootprog loads its self high, you can jump to bootprog to load and run a exe.
Then return to your kernel after wards.

PS. Have you used the CRT trick yet ?, if you include CRT it does not use Dos for things like writeln, so you can use them in your kernel unmoded .
Post 22 May 2011, 17:01
View user's profile Send private message Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel
Dex4u wrote:
Here is a quick example of what you need to do
Code:
{MZ}
uses dos1, strings;
var
 OLDHANDLER : Procedure;

{$F+}
Procedure int21HANDLER(Flags, CS, IP, AX, BX, CX, DX,SI, DI,
DS, ES, BP: Word); Interrupt;
var
 end_memory,top_memory:integer;
 DriveNumber:byte;
Begin

{read character with echo}
IF HI(AX)=$01 THEN
  BEGIN
    ASM
        XOR AX, AX
        int 16h
        mov ah, 0Eh
        int 10h
    END;
  END;
{write character}
IF HI(AX)=$02 THEN
  BEGIN
     ASM
        mov al, dl
        mov ah, 0Eh
        int 10h
      END;
  END;
 {read character without echo}
IF HI(AX)=$07 THEN
   BEGIN
    ASM
        xor ax, ax
        int 16h
    END;
   END;

{ write string; input ds:dx = string (ended with '$')}

IF HI(AX)=$09 THEN
BEGIN
 ASM                                  { ds:dx points to string}
        mov     si,dx                  { ds:si = string}
        cld
 @print_loop:
        lodsb                          {  get next character}
        cmp     al,'$'                   { is it $ ?}
        je      @done              { if so, we're done}
        mov     ah,0eh               {   function 0eh-print character}
        xor     bx,bx                  {  video page 0}
        int     10h
        jmp     @print_loop
 @done:
        mov    ax,0e0ah
        int    10h
        mov    ax,0e0dh
        int    10h
 END;
END;

{ get current drive}
IF HI(AX)=$19 THEN
 BEGIN
  DriveNumber:=0;
    ASM
        mov al,cs:[DriveNumber]
    END;
 END;
{set interrupt vector}
IF HI(AX)=$25 THEN
BEGIN
  ASM
        cmp al, 19h             { do not allow to change int 19h (for rebooting)}
        je  @int21_error

        cli
        xor ah, ah
        shl ax, 2

        push si
        push bx
        push es

        mov si, ax
        xor bx, bx
        mov es, bx

        mov word ptr es:[si], dx                { offset}
        mov bx, ds
        mov word ptr es:[si+2], bx              { segment}

        pop es
        pop bx
        pop si
        sti

        jmp  @endit

  @int21_error:
        mov ax, 0FFFFh
 @endit:
 END;
END;

{get date
IF HI(AX)=$2A THEN
BEGIN

END;}

{set date
IF HI(AX)=$2B THEN
BEGIN

END;}

{get time
IF HI(AX)=$2C THEN
BEGIN

END;}

{set time
IF HI(AX)=$2D THEN
BEGIN

END;}
{jmp int21_error}

{get dos version}
IF HI(AX)=$30 THEN
BEGIN
    AX:=$3031;
END;

{get interrupt vector}
IF HI(AX)=$35 THEN
BEGIN
  ASM
        push ds
        push si

        xor ah, ah
        shl ax, 2
        mov si, ax

        xor bx, bx
        mov ds, bx

        mov bx, word ptr ds:[si+2]
        push bx
        mov bx, word ptr ds:[si]

        pop es

        pop si
        pop ds

   END;
END;


{alloc ram memory}
IF HI(AX)=$48 THEN
BEGIN
 ASM
        mov ax, es
        shr ax, 2
        inc ax
        shl ax, 2
        mov word ptr [end_memory], ax   {; save (to know free memory)}

        int 12h                         {; get ram size (in KB)}
                                      { ; convert in paragraphs: (*64)}
        shl ax, 6
        mov word ptr [top_memory], ax


        mov ax, word ptr cs:[end_memory]
        add ax, bx
        cmp ax, word ptr cs:[top_memory]
        jg @error
        mov word ptr cs:[top_memory], ax


        mov bx, word ptr cs:[top_memory]        { return in bx free paragraphs}
        sub bx, word ptr cs:[end_memory]
        jmp @endit1
  @error:
        stc
        mov ax, 0FFFFh
  @endit1:
 END;
END;
IF HI(AX)=$4C THEN
BEGIN
  ASM
        push cs
        pop ax
        mov ds, ax
        mov es, ax
        mov ip,0FFFFh
   END;
 END;
END;
{$F-}
procedure ShowText; assembler;
const
   Msg   :PChar =

   'This text is shown using DOS ...INT 21h (09h) $';
asm
   mov  dx,word ptr Msg
   mov  ah,9
   int  21h
end;
procedure WriteChr(Chr: Char);
begin
    asm
     MOV      Al, Chr
     PUSHA
     MOV      Ah, 0Eh
     INT      10h
     POPA
    end;
end;
procedure next_line;
 begin
  asm
  MOV  AH,3
  INT  10h
  MOV  AH,2
  INC  DH
  MOV  DL,0
  INT  10h
 end;
end;
PROCEDURE DOS_VER;
BEGIN
 ASM
  mov  aH, 30h
  int  21h
  mov  bl,ah
  mov  aH,0eh
  int  10h
  mov  ax,0e2eh
  int  10h
  mov  al,bl
  mov  aH,0eh
  int  10h
  END;
END;


procedure WritelnA(Str: String);
var
  Pos: Integer;
  Chr: array[0..254] of Char;
begin
    StrPCopy(Chr, Str);

    for Pos := 0 to (Length(Str) - 1)  do
    begin
         WriteChr(Chr[Pos]);
    end;
    next_line;
end;
procedure WriteA(Str: String);
var
  Pos: Integer;
  Chr: array[0..254] of Char;
begin
    StrPCopy(Chr, Str);

    for Pos := 0 to (Length(Str) - 1)  do
    begin
         WriteChr(Chr[Pos]);
    end;
end;
procedure hold;
begin
   asm
    PUSHA
    XOR AX,AX
    INT 16h
    POPA
   end;
end;

Procedure INSTALL_HANDLER;
begin
GetIntVec($21,@OLDHANDLER);
SetIntVec($21,ADDR(int21HANDLER));
end;
PROCEDURE CLS;
BEGIN
 ASM
     mov AH,2
     mov BH,0
     mov DX,0
     int 16
     mov AH,9
     mov CX,2000
     mov AL,' '
     mov BL,7
     int 16
     mov AH,2
     mov BH,0
     mov DX,0
     int 16
 END;
END;
begin
INSTALL_HANDLER;
writelnA('loading kernel 16 !');
hold;
CLS;
writelnA('hello world!');
hold;
writelnA('DOES INT 21 09h WORK?');
HOLD;
SHOWTEXT;
HOLD;
WriteA('The PAS-DOS Version ');DOS_VER;
NEXT_LINE;
hold;
writelnA('press enter to reboot!');
hold;
end.
    


You need to take the asm code from bootprog for loading exe file and replace the pascal exec rtl with yours.
Heres whats in the pascal rtl EXEC
Code:

        TITLE   EXEC

        LOCALS  @@

DATA    SEGMENT WORD PUBLIC

        EXTRN   DosError:WORD,PrefixSeg:WORD

SaveSP          DW      ?
SaveSS          DW      ?

DATA    ENDS

CODE    SEGMENT BYTE PUBLIC

        ASSUME  CS:CODE,DS:DATA

        PUBLIC  Exec

Exec            PROC    FAR

PathArg         EQU     DWORD PTR [BP+10]
CmdLineArg      EQU     DWORD PTR [BP+6]
FileSeg2        EQU     WORD PTR [BP-2]
FileOfs2        EQU     WORD PTR [BP-4]
FileSeg1        EQU     WORD PTR [BP-6]
FileOfs1        EQU     WORD PTR [BP-8]
CmdLineSeg      EQU     WORD PTR [BP-10]
CmdLineOfs      EQU     WORD PTR [BP-12]
EnvironSeg      EQU     WORD PTR [BP-14]
FileBlock1      EQU     BYTE PTR [BP-30]
FileBlock2      EQU     BYTE PTR [BP-46]
Path            EQU     BYTE PTR [BP-126]
CmdLine         EQU     BYTE PTR [BP-254]

        PUSH    BP
        MOV     BP,SP
        MOV     SaveSP,SP
        MOV     SaveSS,SS
        SUB     SP,254
        MOV     DS,PrefixSeg
        MOV     AX,WORD PTR DS:2CH
        MOV     EnvironSeg,AX
        PUSH    SS
        POP     ES
        CLD
        LDS     SI,PathArg
        LEA     DI,Path
        LODSB
        CMP     AL,79
        JB      @@1
        MOV     AL,79
@@1:    CBW
        XCHG    AX,CX
        REP     MOVSB
        XOR     AL,AL
        STOSB
        LDS     SI,CmdLineArg
        LEA     DI,CmdLine
        LODSB
        CMP     AL,126
        JB      @@2
        MOV     AL,126
@@2:    STOSB
        CBW
        XCHG    AX,CX
        REP     MOVSB
        MOV     AL,0DH
        STOSB
        PUSH    SS
        POP     DS
        LEA     SI,CmdLine
        MOV     CmdLineOfs,SI
        MOV     CmdLineSeg,DS
        INC     SI
        LEA     DI,FileBlock1
        MOV     FileOfs1,DI
        MOV     FileSeg1,ES
        MOV     AX,2901H
        INT     21H
        LEA     DI,FileBlock2
        MOV     FileOfs2,DI
        MOV     FileSeg2,ES
        MOV     AX,2901H
        INT     21H
        LEA     DX,Path
        LEA     BX,EnvironSeg
        MOV     AX,4B00H
        INT     21H
        JC      @@3
        XOR     AX,AX
@@3:    MOV     DX,SEG DATA
        MOV     DS,DX
        CLI
        MOV     SP,SaveSP
        MOV     SS,SaveSS
        STI
        MOV     DosError,AX
        POP     BP
        RET     8

Exec            ENDP

        PUBLIC  DosExitCode

DosExitCode     PROC    FAR

        MOV     AH,4DH
        INT     21H
        RET

DosExitCode     ENDP

CODE    ENDS

        END
    


NOTE: There is another way you can do it, take a look at minidos it use bootprog for a loader and as bootprog loads its self high, you can jump to bootprog to load and run a exe.
Then return to your kernel after wards.

PS. Have you used the CRT trick yet ?, if you include CRT it does not use Dos for things like writeln, so you can use them in your kernel unmoded .


Thanks for replying Wink

When I´m compiling the file, it gives me two errors in the dos1 and strings units. Crying or Very sad

Regarding the second file, can I compile it with tasm?

Where can I find the MINIDOS? Embarassed What license has it got? is gpl? Twisted Evil
Post 22 May 2011, 20:46
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

Turbo Pascal ? what's that ?
has it to do with programming ? Wink Razz

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 22 May 2011, 21:30
View user's profile Send private message Send e-mail Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
You can get Minidos here: http://board.flatassembler.net/topic.php?t=5275&start=0

It's freeware you can do what you like with it.


Description: This is the full code to the above
Download
Filename: PassOS.zip
Filesize: 12.44 KB
Downloaded: 387 Time(s)

Post 23 May 2011, 01:16
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
ouadji wrote:

Turbo Pascal ? what's that ?
has it to do with programming ? Wink Razz


Don't touch TurboPascal with your filthy fingers! Evil or Very Mad It is cult compiler and you are too young to talk about it! Razz

BTW: arcangel, Turbo is great tool, but it is too old for any serious work. Better think about shifting to FASM, before the project become too big to be hard to be ported. In FASM you can use all your good habits from pascal programming on new, more powerful level.


Last edited by JohnFound on 24 May 2011, 07:47; edited 1 time in total
Post 23 May 2011, 05:59
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel
Dex4u wrote:
You can get Minidos here: http://board.flatassembler.net/topic.php?t=5275&start=0

It's freeware you can do what you like with it.


The Minidos and PassOS are very very very interesting Twisted Evil Twisted Evil Twisted Evil Twisted Evil

but...Can I execute, for example, the hello.exe program on the Minidos and PassOS?

Code:
program hello;
uses crt;
begin
writeln('hello word');
readln;
end.
    
Post 23 May 2011, 20:52
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
arcangel wrote:
Dex4u wrote:
You can get Minidos here: http://board.flatassembler.net/topic.php?t=5275&start=0

It's freeware you can do what you like with it.


The Minidos and PassOS are very very very interesting Twisted Evil Twisted Evil Twisted Evil Twisted Evil

but...Can I execute, for example, the hello.exe program on the Minidos and PassOS?

Code:
program hello;
uses crt;
begin
writeln('hello word');
readln;
end.
    


You could run it on minidos, but PassOS did not have any load and run files, it was very basic.
As i ended up write most of the function in inline asm, i just thought i would just write it 100% in asm.
Post 23 May 2011, 21:07
View user's profile Send private message Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel
Dex4u wrote:

You could run it on minidos, but PassOS did not have any load and run files, it was very basic.
As i ended up write most of the function in inline asm, i just thought i would just write it 100% in asm.


This is very very very interesting Twisted Evil Twisted Evil Twisted Evil Twisted Evil

I've done a little modification and I've added the program hola.exe Wink Wink

Could it be rewritten for others plataforms? For example, Uzebox? Question

http://belogic.com/uzebox/index.asp

I saw your project FAB, but it doesn't work. How can I write the address of the web? Confused

http://board.flatassembler.net/topic.php?t=8281

Will it work with Minidos?

Thank you Very Happy Very Happy


Description: miminidos
Download
Filename: miMiniDOS.IMA.zip
Filesize: 233.9 KB
Downloaded: 415 Time(s)

Post 24 May 2011, 12:55
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
arcangel wrote:
I saw your project FAB, but it doesn't work. How can I write the address of the web? Confused

FAB was not finished, we did not add the tcp/ip stack.
The main problem is Ethernet card driver, there so many.

One thing that may interest you is fasm macro, with them you can change asm into any language including pascal.

Here is a basic example
http://board.flatassembler.net/topic.php?t=7961
Post 24 May 2011, 18:01
View user's profile Send private message Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel
Dex4u wrote:
arcangel wrote:
I saw your project FAB, but it doesn't work. How can I write the address of the web? Confused

FAB was not finished, we did not add the tcp/ip stack.
The main problem is Ethernet card driver, there so many.

One thing that may interest you is fasm macro, with them you can change asm into any language including pascal.

Here is a basic example
http://board.flatassembler.net/topic.php?t=7961


It's very interesting Very Happy

I am impressed with MiniDos Shocked Shocked

Can I build a driver for the network card and connect to internet with lynx? Twisted Evil Twisted Evil

Would you please guide me about it? Rolling Eyes Rolling Eyes
Post 24 May 2011, 19:13
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Turbo Pascal these days? Hahaha, that's funny...

At-least Turbo Assembler is still on these days, but Pascal, hmmm...
Post 24 May 2011, 20:46
View user's profile Send private message Reply with quote
arcangel



Joined: 19 Aug 2009
Posts: 39
arcangel
typedef wrote:
Turbo Pascal these days? Hahaha, that's funny...

At-least Turbo Assembler is still on these days, but Pascal, hmmm...


My idea is learning about it Cool , and I think that Turbo Pascal is a good way to do it Twisted Evil
Post 25 May 2011, 19:07
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
It's not that crazy an idea, TP is pretty low-level already. I've seen crazier ideas. Besides, it's not the first time Pascal (or derivatives) has been used to write a full-fledged OS: see Modula-2 (Lilith), Modula-3 (SpinOS), Oberon (Oberon), etc.
Post 26 May 2011, 18:00
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
The big problem with TP is that it does not support protected mode compilation (I am not sure about TP7) so even if one create great OS with TP, this OS will be not possible to evolve to something more advanced and useful.
I would suggest using FreePascal, although it is not so good compiler as TP.
Of course using FASM instead of any HLL is the best anyway.
Post 27 May 2011, 06:02
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.