Skip to content

Commit

Permalink
ia32: add passing of graphmode params via syspage and platformctl
Browse files Browse the repository at this point in the history
plo can now store graphics mode details in syspage (i.e. after setting the mode via
VESA VBE) that are then accessible from userspace via platformctl

JIRA: RTOS-906
  • Loading branch information
adamgreloch committed Oct 4, 2024
1 parent a10f91b commit d99dc74
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
11 changes: 11 additions & 0 deletions hal/ia32/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,17 @@ int hal_platformctl(void *ptr)
}
break;

case pctl_graphmode:
if (data->action == pctl_get) {
data->graphmode.width = syspage->hs.graphmode.width;
data->graphmode.height = syspage->hs.graphmode.height;
data->graphmode.bpp = syspage->hs.graphmode.bpp;
data->graphmode.pitch = syspage->hs.graphmode.pitch;
data->graphmode.framebuffer = syspage->hs.graphmode.framebuffer;
return EOK;
}
break;

default:
break;
}
Expand Down
14 changes: 13 additions & 1 deletion include/arch/ia32/ia32.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ typedef struct {
} __attribute__((packed)) pci_dev_t;


/* clang-format off */

typedef struct {
enum { pctl_set = 0, pctl_get } action;
enum { pctl_pci = 0, pctl_busmaster, pctl_reboot } type;
enum { pctl_pci = 0, pctl_busmaster, pctl_reboot, pctl_graphmode } type;

union {
struct {
Expand All @@ -91,8 +93,18 @@ typedef struct {
unsigned int magic;
unsigned int reason;
} reboot;

struct {
unsigned short width;
unsigned short height;
unsigned short bpp;
unsigned short pitch;
unsigned long framebuffer; /* addr_t */
} graphmode;
};
} platformctl_t;

/* clang-format on */


#endif
8 changes: 8 additions & 0 deletions include/arch/ia32/syspage.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ typedef struct {
unsigned int hpetLength;
unsigned long mcfg; /* addr_t */
unsigned int mcfgLength;

struct {
unsigned short width;
unsigned short height;
unsigned short bpp;
unsigned short pitch;
unsigned long framebuffer; /* addr_t */
} __attribute__((packed)) graphmode; /* Graphics mode info */
} __attribute__((packed)) hal_syspage_t;


Expand Down

0 comments on commit d99dc74

Please sign in to comment.