Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
drivers
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Liam Naddell
drivers
Commits
bac44348
Commit
bac44348
authored
Nov 10, 2016
by
Jeremy Soller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to real standard, fix daemonization on real standard
parent
03abcd0e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
15 deletions
+20
-15
ahcid/src/main.rs
ahcid/src/main.rs
+4
-3
e1000d/src/main.rs
e1000d/src/main.rs
+4
-3
ps2d/src/main.rs
ps2d/src/main.rs
+4
-3
rtl8168d/src/main.rs
rtl8168d/src/main.rs
+4
-3
vesad/src/main.rs
vesad/src/main.rs
+4
-3
No files found.
ahcid/src/main.rs
View file @
bac44348
...
...
@@ -7,7 +7,7 @@ extern crate io;
extern
crate
spin
;
extern
crate
syscall
;
use
std
::{
env
,
thread
,
usize
};
use
std
::{
env
,
usize
};
use
std
::
fs
::
File
;
use
std
::
io
::{
Read
,
Write
};
use
std
::
os
::
unix
::
io
::{
AsRawFd
,
FromRawFd
};
...
...
@@ -29,7 +29,8 @@ fn main() {
print!
(
"{}"
,
format!
(
" + AHCI on: {:X} IRQ: {}
\n
"
,
bar
,
irq
));
thread
::
spawn
(
move
||
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
let
address
=
unsafe
{
syscall
::
physmap
(
bar
,
4096
,
MAP_WRITE
)
.expect
(
"ahcid: failed to map address"
)
};
{
let
socket_fd
=
syscall
::
open
(
":disk"
,
syscall
::
O_RDWR
|
syscall
::
O_CREAT
|
syscall
::
O_NONBLOCK
)
.expect
(
"ahcid: failed to create disk scheme"
);
...
...
@@ -69,5 +70,5 @@ fn main() {
}
}
unsafe
{
let
_
=
syscall
::
physunmap
(
address
);
}
}
);
}
}
e1000d/src/main.rs
View file @
bac44348
...
...
@@ -6,7 +6,7 @@ extern crate netutils;
extern
crate
syscall
;
use
std
::
cell
::
RefCell
;
use
std
::
{
env
,
thread
}
;
use
std
::
env
;
use
std
::
fs
::
File
;
use
std
::
io
::{
Read
,
Write
,
Result
};
use
std
::
os
::
unix
::
io
::{
AsRawFd
,
FromRawFd
};
...
...
@@ -29,7 +29,8 @@ fn main() {
print!
(
"{}"
,
format!
(
" + E1000 on: {:X}, IRQ: {}
\n
"
,
bar
,
irq
));
thread
::
spawn
(
move
||
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
let
socket_fd
=
syscall
::
open
(
":network"
,
syscall
::
O_RDWR
|
syscall
::
O_CREAT
|
syscall
::
O_NONBLOCK
)
.expect
(
"e1000d: failed to create network scheme"
);
let
socket
=
Arc
::
new
(
RefCell
::
new
(
unsafe
{
File
::
from_raw_fd
(
socket_fd
)
}));
...
...
@@ -128,5 +129,5 @@ fn main() {
}
}
unsafe
{
let
_
=
syscall
::
physunmap
(
address
);
}
}
);
}
}
ps2d/src/main.rs
View file @
bac44348
...
...
@@ -11,7 +11,7 @@ use std::env;
use
std
::
fs
::
File
;
use
std
::
io
::{
Read
,
Write
,
Result
};
use
std
::
os
::
unix
::
io
::
AsRawFd
;
use
std
::
{
mem
,
thread
}
;
use
std
::
mem
;
use
event
::
EventQueue
;
use
orbclient
::{
KeyEvent
,
MouseEvent
};
...
...
@@ -123,7 +123,8 @@ impl<'a> Ps2d<'a> {
}
fn
main
()
{
thread
::
spawn
(||
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
unsafe
{
iopl
(
3
)
.expect
(
"ps2d: failed to get I/O permission"
);
asm!
(
"cli"
:
:
:
:
"intel"
,
"volatile"
);
...
...
@@ -188,5 +189,5 @@ fn main() {
let
(
keyboard
,
data
)
=
event_queue
.run
()
.expect
(
"ps2d: failed to handle events"
);
ps2d
.handle
(
keyboard
,
data
);
}
}
);
}
}
rtl8168d/src/main.rs
View file @
bac44348
...
...
@@ -7,7 +7,7 @@ extern crate netutils;
extern
crate
syscall
;
use
std
::
cell
::
RefCell
;
use
std
::
{
env
,
thread
}
;
use
std
::
env
;
use
std
::
fs
::
File
;
use
std
::
io
::{
Read
,
Write
,
Result
};
use
std
::
os
::
unix
::
io
::{
AsRawFd
,
FromRawFd
};
...
...
@@ -30,7 +30,8 @@ fn main() {
print!
(
"{}"
,
format!
(
" + RTL8168 on: {:X}, IRQ: {}
\n
"
,
bar
,
irq
));
thread
::
spawn
(
move
||
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
let
socket_fd
=
syscall
::
open
(
":network"
,
syscall
::
O_RDWR
|
syscall
::
O_CREAT
|
syscall
::
O_NONBLOCK
)
.expect
(
"rtl8168d: failed to create network scheme"
);
let
socket
=
Arc
::
new
(
RefCell
::
new
(
unsafe
{
File
::
from_raw_fd
(
socket_fd
)
}));
...
...
@@ -133,5 +134,5 @@ fn main() {
}
}
unsafe
{
let
_
=
syscall
::
physunmap
(
address
);
}
}
);
}
}
vesad/src/main.rs
View file @
bac44348
...
...
@@ -6,7 +6,7 @@ extern crate alloc;
extern
crate
orbclient
;
extern
crate
syscall
;
use
std
::{
env
,
mem
,
thread
};
use
std
::{
env
,
mem
};
use
std
::
fs
::
File
;
use
std
::
io
::{
Read
,
Write
};
use
syscall
::{
physmap
,
physunmap
,
Packet
,
SchemeMut
,
EVENT_READ
,
MAP_WRITE
,
MAP_WRITE_COMBINE
};
...
...
@@ -49,7 +49,8 @@ fn main() {
}
if
physbaseptr
>
0
{
thread
::
spawn
(
move
||
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
let
mut
socket
=
File
::
create
(
":display"
)
.expect
(
"vesad: failed to create display scheme"
);
let
size
=
width
*
height
;
...
...
@@ -103,6 +104,6 @@ fn main() {
}
}
}
}
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment