16k page

[b][red]This message was edited by shaolin007 at 2004-11-3 6:21:33[/red][/b][hr]
[green]
For some reason this is a little difficult for me to swallow but I understand most of it I guess. Please feel free to add any comment that you feel might help me out but here is what I understand from my point of view.

16k page=1*64k segment

there are 16=16k pages which total up to a 1mb in memory

Here's where I think I have a prob...

16k page=last 4 msb in a absolute address?

so absolute address=seg+off*16

01234h[red][italic]edit[/italic][/red]
|
this is our page or the 4 msb

Would this be correct?
[/green]


Comments

  • : [b][red]This message was edited by shaolin007 at 2004-11-3 6:21:33[/red][/b][hr]
    : [green]
    : For some reason this is a little difficult for me to swallow but I understand most of it I guess. Please feel free to add any comment that you feel might help me out but here is what I understand from my point of view.
    :
    : 16k page=1*64k segment
    :
    : there are 16=16k pages which total up to a 1mb in memory
    :
    [/green]
    I don't think there's a standard definition of how big a page is.
    I've seen documents reference 16, 32 and 64k pages. Provided the documentation tells you the size, don't assume the same size for everything. Heck, even the size of a WORD is different between some platforms.

    [green]
    : Here's where I think I have a prob...
    :
    : 16k page=last 4 msb in a absolute address?
    :
    : so absolute address=seg+off*16
    :
    : 01234h[red][italic]edit[/italic][/red]
    : |
    : this is our page or the 4 msb
    :
    : Would this be correct?
    : [/green]

    I would assume so. Since 16k is 16*1024=16384 (or 4000h) anything less than 4000h will be in page 0, 4000->7FFF will be page 1, etc.

    01234h is less than 4000h, it's still page 0.

    -jeff!

  • [red]
    : I don't think there's a standard definition of how big a page is.
    : I've seen documents reference 16, 32 and 64k pages. Provided the documentation tells you the size, don't assume the same size for everything. Heck, even the size of a WORD is different between some platforms.
    [/red]

    [green]
    I'm trying to program the dma controller in real mode and from what I have read the page size there is 16k. I need to calculate the page since the dma controller is only able to access up 64k in memory but the page register lets you access the full 1mb, so I'm trying to get the page part down so I can correctly program the dma page register with the correct page address. When I began learning assembly I didn't fully understand what they meant as page but I just took it as it is and now it's haunting me you could say! :-) I think it's the way they describe it that made it confounding! Anyways, if you could shed some light on dma programming then I would be eternally gratefull! By the way this my first shot at trying system programming which is all new to me.
    [/green]

  • : [red]
    : : I don't think there's a standard definition of how big a page is.
    : : I've seen documents reference 16, 32 and 64k pages. Provided the documentation tells you the size, don't assume the same size for everything. Heck, even the size of a WORD is different between some platforms.
    : [/red]
    :
    : [green]
    : I'm trying to program the dma controller in real mode and from what I have read the page size there is 16k. I need to calculate the page since the dma controller is only able to access up 64k in memory but the page register lets you access the full 1mb, so I'm trying to get the page part down so I can correctly program the dma page register with the correct page address. When I began learning assembly I didn't fully understand what they meant as page but I just took it as it is and now it's haunting me you could say! :-) I think it's the way they describe it that made it confounding! Anyways, if you could shed some light on dma programming then I would be eternally gratefull! By the way this my first shot at trying system programming which is all new to me.
    : [/green]
    :
    :

    The DMA controller uses a single 64k page. DMA can only transfer between 1 and FFFF bytes, and the data must be aligned on 64k boundries.


    You really should take a look at this source code:

    http://www.oldskool.org/pc/BCW/bcw_src.zip

    Starting at line 9842 in the .asm file is my interpretation of how to do soundblaster support in DOS. I've already handled all the stuff you're trying to do, and commented it fairly well (or so I think!)

    I know you want to learn to do it yourself, but having this stuff as a backup can really help.

    This stuff is pretty fresh in my head (I programmed it about 4 months ago) so I still remember most of what I was doing, so paw through the code and ask me any questions you need.

    Note: My code is 8086 compatible (so no fancy 32bit instructions) and uses SB 1.0 functions which (hopefully) carry over into all the newer soundblasters. I am only playing mono 8bit 11k samples from standard .wav format.

    -jeff!
  • [red]
    The DMA controller uses a single 64k page. DMA can only transfer between 1 and FFFF bytes, and the data must be aligned on 64k boundries.
    [/red]

    [green]
    Yea your right but I have to set up the page register to point to the right place in memory for my data right? I downloaded your source and giving it a look see. I'll probably print it out and use it as a reference, the soundblaster part that is. Thanks! :-)
    [/green]

  • : [red]
    : The DMA controller uses a single 64k page. DMA can only transfer between 1 and FFFF bytes, and the data must be aligned on 64k boundries.
    : [/red]
    :
    : [green]
    : Yea your right but I have to set up the page register to point to the right place in memory for my data right? I downloaded your source and giving it a look see. I'll probably print it out and use it as a reference, the soundblaster part that is. Thanks! :-)
    : [/green]

    Yep. It's pretty irritating to think about, but it's actually quite simple to convert a seg:off to a page #. (see my code)

    You have to do the following to play a sample:

    1) get the seg:offset of the sample you want to play.
    2) Based on that seg:offset, figure out which 64k page the sample resides in.
    3) program the DMA controller with the page# and offset of the sample
    4) start the soundblaster playing x samples. The SB and DMA controller handle the actual data transfer; your code will continue executing while the sample plays in the background.

    The sample you want to play cannot be more than 64k in length, and must not cross a 64k page boundry. (samples longer than 64k have to be broken up into multiple samples)

    I believe soundblaster 2.0 stuff has better support for multi-64k samples, but I stuck to 1.0 compatibility because I'm a masochist.

    -jeff!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories