In order to process a second driver you preserve the ES and CX registers. ES is fine but CX has a known value of 0 at this point and more importantly you don't need it to remain. But you do need the SI register to be preserved and incremented because it still points at the "*" asterisk character. For correct counting you also need to reset the BH counter.
Code:
push es ;So we can recover later
push si
...
;; If we get here, we are successfully loaded.
pop si
pop es
inc si ;Skip asterisk
mov bh, 0 ;Reset counter
jmp get_dem_filenames
This will be implemented at a later point in time, for now I am primarily focused on getting a buildable kernel out that works in terms of basic structure.
In order to process a second driver you preserve the ES and CX registers. ES is fine but CX has a known value of 0 at this point and more importantly you don't need it to remain. But you do need the SI register to be preserved and incremented because it still points at the "*" asterisk character. For correct counting you also need to reset the BH counter.
Code: