Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

KBFR 1.97 "lastest" beta... (Announce)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 23.06.2011, 12:51

Any reason not to use 21.49 now? Not important though.

; 5 - Mark our environment block, if any, FREE :
                mov     CX,DS:[10h+2Ch]

This should be:
; 5 - Mark our environment block, if any, FREE :
                mov     CX,es:[10h+2Ch]

As otherwise, you're accessing the old PSP which as you know is already freed here. (In any case, independently of PSP relocations and critical sections, I still don't get why you don't just free the environment before splitting MCBs and all.)

; 6 - ask DOS for a suitable block; make it owned by system
                mov     BX, (offset EndofInt15) -1
                shr     BX, 4
                inc     BX      ; needed paragraphs

The comment is outdated, because this version of the installer marks the block as self-owned instead. The computation is unnecessarily carried out at run-time. And what I actually wanted to say about this isn't true. (I wasn't aware that ((x-1)>>4)+1 equals (x+15)>>4 except in corner cases but it makes sense if you think about it.)

However, what I noticed there is that you're using additions from the 186 instruction set, which is okay for a 15.4F driver, but it would be better if you actually checked for such a CPU before using those.

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
22781 Postings in 2123 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum