Trixter
Veteran Member
Now I'm really confused -- are you trying to create a BIOS whose segment blocks match IBM's? If you're not going to copy IBM's code exactly, what would be the point? (There are a handful of programs that rely on specific code located at specific points in the ROM but these are all mostly programs from 1981 or 1982 and don't work on anything later, so they're not much of a desired supportable target)
I think the very best thing you can do is to look at IBM's BIOS, section by section, and just re-implement everything you see. Look at what a particular function takes as input and what it supplies as output, then put away the source code and write assembler that performs the work of that function. Your code may not be as optimized as IBM's right off the bat, but because you won't be including IBM's BASIC in ROM, you have extra space to work with.
The only "infringing" part of this is when you DO get to optimizing the code, there are some obvious and only choices for speed or space optimization... which are the same optimizations that IBM made in some places, so you may find yourself accidentally writing code that just happens to match what IBM did. But this is a hobby project, you are not selling anything, and IBM is not going to sue you, so it doesn't matter.
I'm slightly envious, because if I had the time for more projects, I'd love to do this as well because there are very many places in the BIOS that can be sped up when it comes to screen/text updates and I think that would be cool to optimize.
Trivia: Some code in the BIOS looks like it trades speed for size but in fact no speed is lost in some cases because the code is running out of ROM which takes one less cycle to read (4 cycles to read a byte of RAM, 3 for ROM). Writing a character while avoiding CGA "snow" is one example that comes to mind; if you perform that code out of RAM, it doesn't work and you see snow, but out of ROM it just barely works and there is no snow.
I think the very best thing you can do is to look at IBM's BIOS, section by section, and just re-implement everything you see. Look at what a particular function takes as input and what it supplies as output, then put away the source code and write assembler that performs the work of that function. Your code may not be as optimized as IBM's right off the bat, but because you won't be including IBM's BASIC in ROM, you have extra space to work with.
The only "infringing" part of this is when you DO get to optimizing the code, there are some obvious and only choices for speed or space optimization... which are the same optimizations that IBM made in some places, so you may find yourself accidentally writing code that just happens to match what IBM did. But this is a hobby project, you are not selling anything, and IBM is not going to sue you, so it doesn't matter.
I'm slightly envious, because if I had the time for more projects, I'd love to do this as well because there are very many places in the BIOS that can be sped up when it comes to screen/text updates and I think that would be cool to optimize.
Trivia: Some code in the BIOS looks like it trades speed for size but in fact no speed is lost in some cases because the code is running out of ROM which takes one less cycle to read (4 cycles to read a byte of RAM, 3 for ROM). Writing a character while avoiding CGA "snow" is one example that comes to mind; if you perform that code out of RAM, it doesn't work and you see snow, but out of ROM it just barely works and there is no snow.
Last edited: