flat assembler
Message board for the users of flat assembler.

Index > DOS > I need some advice, I am writing a big DOS project ...

Author
Thread Post new topic Reply to topic
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 17 Jun 2003, 12:32
So, just now I am writing a big DOS project using FASM. It's an special IDE for FASM for OS development. It will start your OS directly without reboot, and then after exit you will go back to the IDE. The idea is to give to developpers all extras of Windows in DOS - file manager, MDI interface windows, buttons etc.

So, the problem is with text editor. Almost all is ready, including syntax highlight, but I can't choose the general strategy for handling text files in memory. (The memory is limited because I want to work only in 1st MByte, because the other memory will be reserved for fasm compiler and running application/OS) So here are some variants:

1. Whole file in one segment in memory as long string with CR on every line and NULL for end. 64k maximum files.

2. Double linked list in memory. This allocates min 32 bytes of memory per line, even if the line is empty.

3. The file is copyed in one (or 2) temporary files on hard disk. In memory is only small part: about 100 lines. Here the problem is with speed maybe. But the IDE will open many big files without problems.
Post 17 Jun 2003, 12:32
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 17 Jun 2003, 14:12
I'm using the second variant for the ASMEDIT control in Win32 GUI version of fasm, and it was based on my old text mode editor for DOS called fedit. Each line has the fixed length of 108h bytes, first dword contains address of previous line, second dword contains address of next line, and the rest (256 bytes) is for the line data. If one of the addresses is zero, it means that this is the first or last line in file. If first address is -1, this line has been deleted and can be reallocated. I'm also using the same 108h byte pieces for the undo buffer, so the memory allocation sheme is the same for all purposes.
Post 17 Jun 2003, 14:12
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 17 Jun 2003, 14:41
Hi Privalov.

Yes, this variant is very tepmting and I hardly hold myself of using it Very Happy
The reason is the fact that common assembly lines are very short and this variant will waste a lot of memory for every file. In Windows this is maybe not a problem, but I must live with 300..400kbytes in this project.

Hm, what if I make this array as a file. Do you think it will be fast enough?
Post 17 Jun 2003, 14:41
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 17 Jun 2003, 18:28
JohnFound wrote:
but I must live with 300..400kbytes in this project.

What about only keeping a few lines (the visible+a few extra) in memory at a time, and then read the text from the disk as needed, perhaps use a temporary swap file for saving the edited/unsaved files? It would be slow if one uses floppies (which IMO should die Twisted Evil Wink ) thought.

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 17 Jun 2003, 18:28
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 17 Jun 2003, 18:33
To scientica:

Yes I think this will be the end version. Maybe slow, but it will give me opportunity to open many and big files. and you know that OS sources are big in the most cases.
Post 17 Jun 2003, 18:33
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
keyoke



Joined: 18 Jun 2003
Posts: 56
Location: London
keyoke 19 Jun 2003, 10:36
JohnFind,
Can you make your ide avaliable for us...that would be great.
Post 19 Jun 2003, 10:36
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 19 Jun 2003, 12:00
Hi, keyoke.
Yes, this IDE will be free. But it is still in very early state. So, if you are interesting, here is little demo. The interface is almost done. So, say your opinion. Smile

http://johnfound.hit.bg/asm/demo.zip
http://spaceglyph.mail333.com/demo.zip
Post 19 Jun 2003, 12:00
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
asmgges



Joined: 17 Jun 2003
Posts: 86
Location: France
asmgges 19 Jun 2003, 13:02
Hi ! John Very Happy

It is promising ! Cool
Good work !

Friendly...Gges
Post 19 Jun 2003, 13:02
View user's profile Send private message Visit poster's website Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 19 Jun 2003, 13:08
WOW! Shocked
That's a wonderfull pice of code! How did you customized the font?

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 19 Jun 2003, 13:08
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 19 Jun 2003, 13:52
So, this is special text mode 90x36 with some tricky semi-graphic elements - like scrollbar thumbs and mouse pointers. Maybe I must publish the whole source, maybe it will be usefull for someone, because it's a stand-alone library for this type of semi-GUI.

OK, look at the source:

http://spaceglyph.mail333.com/semigui.zip

P.S. it's free for use and change, but copyrighted, so if you use this code, put somewhere in the about box - "based on works of John Found" or something similar. Very Happy
Post 19 Jun 2003, 13:52
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
keyoke



Joined: 18 Jun 2003
Posts: 56
Location: London
keyoke 20 Jun 2003, 06:23
Looks good...cant wait for the end result
Post 20 Jun 2003, 06:23
View user's profile Send private message Visit poster's website Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 21 Jun 2003, 15:21
[quote="JohnFound"]
So, the problem is with text editor. Almost all is ready, including syntax highlight, but I can't choose the general strategy for handling text files in memory. (The memory is limited because I want to work only in 1st MByte, because the other memory will be reserved for fasm compiler and running application/OS)


the strategy that i use is:
1o make a index of the file and store it in memory leaving the file on disk
2o store modified lines of txt in memory using a linked list whith the number of the line and the relative number to calculate the equivalent line in the file
3o save changes to disk and free memory.
if you are interested i can send you the source code of my text editor, but it only work whith my Os.
Post 21 Jun 2003, 15:21
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 21 Jun 2003, 20:28
Hi Octavio.
Your idea is interesting. Thank you. Please, send me ( johnfound@abv.bg ) these sources. (I hope they are written on FASM, but if not, they will be useful too.)

Regards
John Found
Post 21 Jun 2003, 20:28
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 23 Jun 2003, 17:46
JohnFound wrote:
Hi Octavio.
Your idea is interesting. Thank you. Please, send me ( johnfound@abv.bg ) these sources. (I hope they are written on FASM, but if not, they will be useful too.)

Regards
John Found

I tried to send you a message but:

This Message was undeliverable due to the following reason:

Each of the following recipients was rejected by a remote mail server.
The reasons given by the server are included to help you determine why
each recipient was rejected.

Recipient: <johnfound@abv.bg>
Reason: [1] cyberangels/DeSantos, see http://spews.org/ask.cgi?S2492TERRA-NETWORKS http://groups.google.com/groups?q=rra.%2Bes+group:news.admin.net-abuse.sightings&hl=&lr=e=F-8&sa=scoring=

Please reply to <postmaster@teleline.es>
if you feel this message to be in error.
Post 23 Jun 2003, 17:46
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 23 Jun 2003, 21:43
Octavio, I am sorry for inconvenience, but you know, these free mails... Sad
So, tomorrow I will try to send you my office mail address ( I can't remember it just now Wink )
Post 23 Jun 2003, 21:43
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.