Current break round up

Kircsi Tibor <[email protected]>
Newsgroups gmane.linux.assembly
Message-ID <1222802784.8421.10.camel@kirilla-desktop>
Hi,

Sorry for my english. I started learn assembly again after 15 years.
Now, I'm learning about memory management and sys_brk system call. I've
created a really simple program, which try to extend the heap size. I've
read, when sys_brk is called with the new break address(last usable
address of the heap or data segment), it will be rounded up to the next
nearest page, but it didn't. Am I misundestand somthing?

# meminf.s
# 2008.09.25.
# PURPOSE: Test current_break address round up at sys_brk call

.include "../sharedlibs/linux.s"

.section .text
        .globl  _start
_start:
        movl    %esp, %ebp

        movl    $0, %ebx                # %ebx = 0, get the current
curret_break
        movl    $SYS_BRK, %eax
        int     $INT                    # %eax = address of
current_break

        addl    $0x1002, %eax           # add 4098 to current
current_break
        movl    %eax, %ebx              # %ebx = the address of the new
current_break
        movl    $SYS_BRK, %eax
        int     $INT

        movl    $0, %ebx                # set the return value of the
program
        movl    $SYS_EXIT, %eax
        int     $INT

regards,
Kiri


--
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.