function(?) data in mpx386.s - Minix

This is a discussion on function(?) data in mpx386.s - Minix ; Hi! I just stumbled over k_stktop in the section/function/whatsoever data in mp386.s according to http://www.minix3.org/doc/AppendixB-Index.html data is a function, but I have absolutley no clue, what the following code means: " ..sect .rom ! Before the string table please .data2 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: function(?) data in mpx386.s

  1. function(?) data in mpx386.s

    Hi!

    I just stumbled over k_stktop in the
    section/function/whatsoever data in mp386.s
    according to
    http://www.minix3.org/doc/AppendixB-Index.html
    data is a function, but I have absolutley no
    clue, what the following code means:
    "
    ..sect .rom ! Before the string table please
    .data2 0x526F ! this must be the first data entry (magic #)

    ..sect .bss
    k_stack:
    .space K_STACK_BYTES ! kernel stack
    k_stktop: ! top of kernel stack
    .comm ex_number, 4
    .comm trap_errno, 4
    .comm old_eip, 4
    .comm old_cs, 4
    .comm old_eflags, 4
    "
    I guess it is some kind of "declaration", but it
    doesn't looks like a function. I am also unable
    to find "comm" or ".comm" anywhere in the intel
    reference manuals.

    well according to this comment, my guess seems right,
    but then, "data" can't be a function or am I totally of
    the road?
    "
    ! Some data storage is also allocated at the end of this file. This data
    ! will be at the start of the data segment of the kernel and will be read
    ! and modified by the boot monitor before the kernel starts.
    "

    thx in advance
    Bernhard

  2. Re: function(?) data in mpx386.s

    Hi Bernhard,

    (Comments below)

    Bernhard Kast wrote:

    > Hi!
    >
    > I just stumbled over k_stktop in the
    > section/function/whatsoever data in mp386.s
    > according to
    > http://www.minix3.org/doc/AppendixB-Index.html
    > data is a function, but I have absolutley no
    > clue, what the following code means:
    > "
    > .sect .rom ! Before the string table please
    > .data2 0x526F ! this must be the first data entry (magic #)


    This part just puts the two byte constant "Ro" in the .rom section as a
    "magic" number.

    >
    > .sect .bss
    > k_stack:
    > .space K_STACK_BYTES ! kernel stack
    > k_stktop: ! top of kernel stack


    This part allocates the kernel stack in the .bss section.
    The stack starts at k_stack and extends K_STACK_BYTES until k_stktop.
    The .space directive allocates space in a section. The k_staktop label is
    defined because it is where the stackpointer is initialized to. The stack
    then grows down in memory towards k_stack.

    > .comm ex_number, 4
    > .comm trap_errno, 4
    > .comm old_eip, 4
    > .comm old_cs, 4
    > .comm old_eflags, 4


    These .comm directives allocate space for these variables: each one is four
    bytes.

    > "
    > I guess it is some kind of "declaration", but it
    > doesn't looks like a function. I am also unable
    > to find "comm" or ".comm" anywhere in the intel
    > reference manuals.
    >
    > well according to this comment, my guess seems right,
    > but then, "data" can't be a function or am I totally of
    > the road?
    > "
    > ! Some data storage is also allocated at the end of this file. This data
    > ! will be at the start of the data segment of the kernel and will be read
    > ! and modified by the boot monitor before the kernel starts.
    > "


    Right. "data" defines some data items.

    >
    > thx in advance
    > Bernhard


    -Rich

    --
    Richard Pennington
    Email: rich@pennware.com
    http://www.pennware.com ftp://ftp.pennware.com

+ Reply to Thread