Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7592893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:01:16+00:00 2026-05-30T21:01:16+00:00

I am doing an Operating System assignment, which is adding a new system call.

  • 0

I am doing an Operating System assignment, which is adding a new system call. The system call, which is called “dumbfork”, needs to fork a process without using copy-on-write policy. So basically it has to copy the entire address space to the child process.

I was able to set up and recompile the system kernel. I can invoke my custom system call, but I don’t know how to actually implement the dumbfork to disable COW feature. One of the source code shows me how sys_vfork is calling do_fork. Dumbfork should be similar to sys_vfork. I don’t know how I can set the parameters of do_fork. I tried to mimick how sys_fork is implemented, and it gives me a NULL pointer dereferencing error. Can anyone enlighten me on this problem.

asmlinkage long sys_dumbfork(struct pt_regs *regs)
{
  return do_fork(SIGCHLD, regs->sp, regs, 0, NULL, NULL);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:01:18+00:00Added an answer on May 30, 2026 at 9:01 pm

    do_fork is a very general function which is used in fork, vfork and clone calls. The most similar one to what you want to achieve is obviously fork (clone is mainly intended for threads, vfork does not copy address space at all).

    In your case, the best solution seems to be making do_fork accept new flag, somthing like CLONE_COPY_EVERYTHING_RIGHT_NOW. Then you should find code responsible for copy-on-write and depending on whether this flag was passed to do_fork: copy entire adress space or (if flag was not passed, what would indicate that do_fork was called from one of the original system calls) use existing copy-on-write policy. Your dumbfork system call will look almost the same like fork call, except the additional flag.

    asmlinkage int sys_dumbfork(struct pt_regs *regs)
    {
         return do_fork(CLONE_COPY_EVERYTHING_RIGHT_NOW | SIGCHLD, regs->sp, regs, 0, NULL, NULL);
    }
    

    This page, although outdated, may be very helpful, especially the sections Fork ICA and Copy on Write. There is a function called during fork syscall copy_page_range which marks pages read-only. That looks like the place you should consider for adding your memory copying code. Moreover, function do_wp_page is called during page faults in order to copy previously shared page someone wanted write to, that may be a good example how such copying should look like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a project on filesystems on a university operating systems course, my C
I am doing a C# application targeting WinXP, Vista, and 7 Operating Systems. One
Doing an ajax get request works as expected using the following code: $.ajax({ type:
I have a problem to detect when used in GNOME or KDE operating system
I'm developing an operating system and rather than programming the kernel, I'm designing the
Python's access to environment variables does not accurately reflect the operating system's view of
What changes, if any, would an operating system need to implement to take full
Let me explain. I'm using webots in combination with aldebaran SDK . My operating
UNIX file-locking is dead-easy: The operating system assumes that you know what you are
I am writing my own operating system and I want to validate whether dirty

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.