Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
virtual_game_machine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
adrian.spycher
virtual_game_machine
Commits
0ef22830
Commit
0ef22830
authored
6 months ago
by
adrian.spycher
Browse files
Options
Downloads
Patches
Plain Diff
feat: handle run_pv and run_phys
parent
084c5f96
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
guest/console/console.h
+1
-1
1 addition, 1 deletion
guest/console/console.h
guest/console/console_pv.c
+1
-1
1 addition, 1 deletion
guest/console/console_pv.c
guest/guest_main.c
+12
-22
12 additions, 22 deletions
guest/guest_main.c
vmm/operation.c
+3
-3
3 additions, 3 deletions
vmm/operation.c
with
17 additions
and
27 deletions
guest/console/console.h
+
1
−
1
View file @
0ef22830
...
...
@@ -7,6 +7,6 @@
// --- FUNCTION ---
void
console_send
_pv
(
char
*
str
);
void
console_
pv_
send
(
char
*
str
);
#endif // _CONSOLE_H_
This diff is collapsed.
Click to expand it.
guest/console/console_pv.c
+
1
−
1
View file @
0ef22830
...
...
@@ -10,7 +10,7 @@
// --- FUNCTION ---
void
console_send
_pv
(
char
*
str
)
{
void
console_
pv_
send
(
char
*
str
)
{
hyper_virtual_console_params_t
param_console
;
param_console
.
msg
=
(
uint64_t
)
str
;
...
...
This diff is collapsed.
Click to expand it.
guest/guest_main.c
+
12
−
22
View file @
0ef22830
#include
<stdint.h>
#include
"idt.h"
#include
"utils.h"
#include
"x86.h"
#include
"pmio.h"
#include
"shared/hypercall_params.h"
#include
"ide/ide.h"
#include
"gfx/gfx.h"
#include
"timer/timer.h"
#include
"console/console.h"
...
...
@@ -14,36 +10,30 @@
// If PV == 1 => uses paravirtualized drivers (when available)
// If PV == 0 => uses physical (hardware) drivers (when available)
#if PV == 1
#define timer_sleep timer_sleep_pv
#define timer_wait timer_pv_wait
#define console_send console_pv_send
#define gfx_init gfx_pv_init
#else
#define timer_sleep timer_sleep_phys
#define timer_wait timer_phys_wait
#define console_send console_pv_send
#define gfx_init gfx_phys_init
#endif
// Dummy examples
// void timer_sleep_pv(int usec) {}
// void timer_sleep_phys(int usec) {}
void
guest_main
()
{
idt_init
();
// Initialize interrupt subsystem
sti
();
// Enable hardware interrupts
// -
pv
console -
// - console -
char
*
str
=
"Hi from the guest !"
;
console_send_pv
(
str
);
// - pv timer -
timer_pv_wait
(
1e6
);
console_send
(
str
);
// -
phys
timer -
timer_
phys_
wait
(
1e6
);
// - timer -
timer_wait
(
1e6
);
// -
pv
gfx init -
// - gfx init -
gfx_pv_init
(
1920
,
1080
);
// - phys gfx init -
/* gfx_phys_init(1920, 1080); */
// timer_sleep(100000);
timer_wait
(
1e7
);
}
This diff is collapsed.
Click to expand it.
vmm/operation.c
+
3
−
3
View file @
0ef22830
...
...
@@ -44,7 +44,7 @@ void op_callback_console_conclude(void *addr) {
hyper_virtual_console_params_t
*
p_consol
=
(
hyper_virtual_console_params_t
*
)
addr
;
printf
(
"
hypercall
: sending a message...
\n
"
);
printf
(
"
action
: sending a message...
\n
"
);
printf
(
"%s
\n
"
,
(
char
*
)
p_consol
->
msg
);
}
...
...
@@ -57,7 +57,7 @@ void op_callback_timer_conclude(void *addr) {
hyper_timer_sleep_params_t
*
p_timer
=
(
addr
==
NULL
)
?
&
param_timer
:
(
hyper_timer_sleep_params_t
*
)
addr
;
printf
(
"
hypercall
: setting up a %dus timer...
\n
"
,
p_timer
->
us
);
printf
(
"
action
: setting up a %dus timer...
\n
"
,
p_timer
->
us
);
usleep
(
p_timer
->
us
);
}
...
...
@@ -75,7 +75,7 @@ void op_callback_gfx_init_conclude(void *addr) {
hyper_init_gfx_params_t
*
p_gfx_init
=
(
addr
==
NULL
)
?
&
param_gfx_init
:
(
hyper_init_gfx_params_t
*
)
addr
;
printf
(
"
hypercall
: initializing gfx %dx%d...
\n
"
,
p_gfx_init
->
width
,
p_gfx_init
->
height
);
printf
(
"
action
: initializing gfx %dx%d...
\n
"
,
p_gfx_init
->
width
,
p_gfx_init
->
height
);
width_gfx
=
p_gfx_init
->
width
;
height_gfx
=
p_gfx_init
->
height
;
sem_post
(
&
sem_gfx
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment