Linux assembly list
 help / color / mirror / Atom feed
From: Kircsi Tibor <tkircsi@gmail.com>
To: linux-assembly@vger.kernel.org
Subject: Current break round up
Date: Tue, 30 Sep 2008 21:26:24 +0200	[thread overview]
Message-ID: <1222802784.8421.10.camel@kirilla-desktop> (raw)

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



             reply	other threads:[~2008-09-30 19:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30 19:26 Kircsi Tibor [this message]
2008-10-01 13:43 ` Current break round up Frank Kotler
2008-10-01 14:40   ` Tibor Kircsi
     [not found]   ` <61990392562924881677723846250054653396-Webmail2@me.com>
2008-10-01 18:22     ` Frank Kotler
2008-10-01 19:03       ` Kircsi Tibor
2008-10-01 20:27         ` Frank Kotler
2008-10-02  7:27           ` Tibor Kircsi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1222802784.8421.10.camel@kirilla-desktop \
    --to=tkircsi@gmail.com \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox