-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved initial usermode program from usermode.c to a separate binary g…
…enerate from um.S and um.ld. Later, embed the binary into boot32.
- Loading branch information
Showing
8 changed files
with
90 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/*****************************************************************************/ | ||
/* File: um.S */ | ||
/* */ | ||
/* Description: Usermode code. */ | ||
/* */ | ||
/* Author: Shoily O Rahman <[email protected]> */ | ||
/* */ | ||
/* Date: Jun 20, 2021 */ | ||
/* */ | ||
/*****************************************************************************/ | ||
|
||
.code32 | ||
.text | ||
|
||
.globl _um_start | ||
_um_start: | ||
|
||
push %ebp | ||
mov %esp,%ebp | ||
sub $0x4,%esp | ||
movl $0x1,-0x4(%ebp) | ||
loop: | ||
int $0x80 | ||
mov -0x4(%ebp),%eax | ||
inc %eax | ||
mov %eax,-0x4(%ebp) | ||
jmp loop | ||
nop | ||
leave | ||
ret | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*****************************************************************************/ | ||
/* File: mpinit.ld */ | ||
/* */ | ||
/* Description: ld script file for initializing multiple (application) */ | ||
/* processors. */ | ||
/* */ | ||
/* Author: Shoily O Rahman <[email protected]> */ | ||
/* */ | ||
/* Date: Oct 7, 2020 */ | ||
/* */ | ||
/*****************************************************************************/ | ||
|
||
OUTPUT_FORMAT(elf32-i386) | ||
OUTPUT_ARCH(i386) | ||
|
||
/* This will overwrite default boot sector */ | ||
ENTRY(_um_start) | ||
|
||
PHDRS { | ||
text PT_LOAD FILEHDR PHDRS; | ||
data PT_LOAD; | ||
bss PT_LOAD; | ||
} | ||
|
||
SECTIONS | ||
{ | ||
. = 0x10000000; | ||
.text : | ||
{*(.text); } : text | ||
.data : | ||
{*(.data); } : data | ||
.bss : | ||
{*(.bss); } : bss | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters