Commit Graph

434 Commits

Author SHA1 Message Date
a6d4f157b6
Fix i686 build 2024-01-10 20:00:26 +01:00
c4450e88ab
Add common memory related routines to XTLDR protocol 2024-01-10 19:51:27 +01:00
53cd4e0052
Cleanup PE/COFF related structures 2024-01-10 16:05:36 +01:00
4412d4fc98
Rewrite core of the XTLDR boot loader
Reviewed-on: xt-sys/exectos#7
Reviewed-by: Piotr Likoski <likoski@noreply.codingworkshop.git>
Co-authored-by: Rafal Kupiec <belliash@codingworkshop.eu.org>
Co-committed-by: Rafal Kupiec <belliash@codingworkshop.eu.org>
2024-01-09 18:51:04 +01:00
44905bb71d
Add missing whitespace character to the comment 2024-01-07 00:18:00 +01:00
1206069882
Add ability to produce linker map file 2024-01-02 10:52:03 +01:00
f00b1b620f
Add SEGMENT macro for specifying a segment in which the object will be allocated 2023-12-30 01:04:02 +01:00
493dbd0a5a
Add EFI TUI definitions 2023-12-15 20:12:30 +01:00
579b4dc970
Implement RtlTrimLeftString(), RtlTrimRightString() and RtlTrimString() routines 2023-12-09 20:18:02 +01:00
d7fbe531fd
Improvements in string and wide string support
* Implement RtlCompareString(), RtlCompareStringInsensitive(), RtlCompareWideString() and RtlCompareWideStringInsensitive()
* Rename some routines t omatch naming conventions
* Switch to CHAR in string operations
2023-12-06 23:00:18 +01:00
146a331c80
Let UEFI firmware load xtldr into lower half 2023-12-02 09:02:04 +01:00
53d84b772a
Add missing commas 2023-11-29 20:17:31 +01:00
a90a30ff7a
Move XTOS GUIDs into separate header 2023-11-29 17:59:53 +01:00
7a60f46f24
Add preprocessor macro for including common headers and source files across different architectures 2023-11-29 16:12:55 +01:00
db1f693d9c
Corrections to UEFI_FIRMWARE_INFORMATION and KERNEL_INITIALIZATION_BLOCK 2023-11-29 15:57:09 +01:00
0d1fcde3a5
Add missing StallScaleFactor to KPROCESSOR_BLOCK 2023-11-28 23:08:35 +01:00
f6c621c2a6
Basic processor initialization code 2023-11-28 22:31:39 +01:00
c4ccf52782
Correct code formatting 2023-11-28 14:05:08 +01:00
e5adc31af7
Implement basic APIC support, including X2APIC 2023-11-27 22:38:15 +01:00
4ca4e298f0
Add more PIC/APIC related definitions 2023-11-26 23:35:14 +01:00
5b48525b1d
Increase commit hash to 10 characters to match Gitea 2023-11-26 16:26:22 +01:00
4701351bd7
Add missing SYNC_LEVEL definition 2023-11-25 22:14:45 +01:00
14a966043e
Add missing Interrupt request level definitions 2023-11-25 18:50:59 +01:00
0e6bf984a5
Add APIC vector definitions 2023-11-25 18:33:01 +01:00
55cc62f5a0
Rename KIRQL to KRUNLEVEL type 2023-11-25 00:32:55 +01:00
3c4ebe12e1
POSIX compliant stream redirection
Reviewed-on: xt-sys/exectos#1
Reviewed-by: Rafal Kupiec <belliash@noreply.codingworkshop.git>
Co-authored-by: Pedro Valadés <perikiyoxd@gmail.com>
Co-committed-by: Pedro Valadés <perikiyoxd@gmail.com>
2023-11-23 23:26:26 +01:00
c526e63b7a
Add EFI Framework MP services protocol related structures 2023-11-23 15:38:32 +01:00
d8403d01f5
Verify kernel and boot loader compatibility 2023-11-22 17:22:57 +01:00
c4143c63f9
Enable LLVM MASM Assembly 2023-11-20 23:30:44 +01:00
a3c28cee73
Initial XTLDR APIC support, finds and maps base APIC address for kernel 2023-11-20 15:18:22 +01:00
3d0a48df26
Give qemu direct access to the terminal 2023-11-19 20:41:21 +01:00
575b842d05
Add APIC Registers address map (APIC_REGISTER enumeration list) 2023-11-19 00:57:27 +01:00
42b7c3698c
Add missing I/O register routines forward references 2023-11-19 00:41:21 +01:00
64ffe0d7d7
Add EFI task priority levels 2023-11-17 00:11:30 +01:00
71e7adadbd
Correct typo 2023-11-17 00:10:54 +01:00
d083d00ab1
Add EFI MP services protocol structures 2023-11-16 23:06:01 +01:00
1a932468a2
Add some DPC related stubs 2023-11-16 14:53:54 +01:00
67496bef28
Add KLOCK_QUEUE_HANDLE structure definition 2023-11-11 11:36:22 +01:00
91d65bb937
Define max ULONG type limit 2023-11-11 09:41:44 +01:00
83c0accc5f
Update EFLAGS masks 2023-11-09 16:12:24 +01:00
641b34b119
Fixes in i686 version of KepInitializeThreadContext() 2023-11-08 16:06:01 +01:00
362eefc2b3
Fixes in AMD64 version of KepInitializeThreadContext() to get rid of PageFault exception 2023-11-07 15:34:49 +01:00
91ce0f9947
Compensate missing return address, which is a 4-byte on i686 and an 8-byte on amd64 2023-11-05 20:07:13 +01:00
ba833422b0
Implement ExCompleteRundownProtection() and ExReInitializeRundownProtection() routines and add stub for ExWaitForRundownProtectionRelease() 2023-11-05 09:50:04 +01:00
e11ef2f008
Use correct calling convention for a deferred routine 2023-10-30 15:28:00 +01:00
aa17be6eb3
Implement KeSetTargetProcessorDpc() routine 2023-10-29 19:59:21 +01:00
be7981f614
Implement KeInitializeThreadedDpc() and export it together with KeInitializeDpc() 2023-10-29 19:45:45 +01:00
f05a262da2
Cleanup XTDK and XTOSKRNL headers 2023-10-29 09:58:47 +01:00
841a6b304b
Cleanup KE subsystem headers 2023-10-29 09:14:46 +01:00
798e4c1d22
Cleanup MM subsystem headers 2023-10-29 00:52:05 +02:00
cc3e9eb5e6
Add routines used by XTLDR 2023-10-29 00:31:57 +02:00
600c86949b
Cleanup RTL subsystem headers 2023-10-29 00:14:01 +02:00
d920cae481
Fix build by defining more routines used by XTLDR 2023-10-28 23:41:52 +02:00
ad15c55a39
Cleanup AR subsystem headers 2023-10-28 23:35:34 +02:00
d55946c3cf
Cleanup HL subsystem headers 2023-10-28 22:56:04 +02:00
ebb740b0e7
Add more readmes to describe XTOS components and source code tree directories 2023-05-18 21:24:33 +02:00
e11d9dcfad
Make a place for XTBK 2023-05-18 21:11:36 +02:00
42669bcfb3
Import readme for XTDK 2023-05-18 21:00:35 +02:00
9a059b407e
The declspec 'naked' attribute is not supported on 'x86_64', use attribute instead 2023-04-12 20:50:42 +02:00
358b20f1a1
Reorder routines 2023-04-04 22:35:06 +02:00
4073b1589d
Rename endian conversion routines to match naming convention 2023-04-04 21:02:14 +02:00
2257ad1567
Add XTASSEMBLY routine modifier to instruct compiler to generate code without prolog and epilog 2023-03-28 17:33:38 +02:00
bf3d56385f
Add missing forward declarations 2023-03-24 15:39:07 +01:00
6402a0d0a4
Update EDK2 OVMF firmware 2023-03-20 22:28:43 +01:00
2827bb400f
Implement ExAcquireRundownProtection() and ExReleaseRundownProtection() routines 2023-03-18 11:11:06 +01:00
1f8026db2f
Implement RtlInterlockedCompareExchangePointer() and RtlInterlockedDecrementLongPtr() atomic routines 2023-03-17 18:06:53 +01:00
934dba37a1
Initial kernel events support 2023-03-17 16:46:18 +01:00
e0778d0a12
Introduce kernel executive 2023-03-16 23:40:38 +01:00
e6b64b741a
Initialize thread context for i686 2023-03-15 23:05:18 +01:00
3afbc7e419
Introduce SIMD save area in place of FN/FX and use anonymous union inside FX_SAVE_AREA structure 2023-03-15 22:19:18 +01:00
a8fa702b05
Unify KSWITCH_FRAME naming with AMD64 2023-03-15 19:15:31 +01:00
10ccf67e8e
Add missing forward declarations 2023-03-14 22:50:32 +01:00
cec8a13e4c
Add context control flags and thread frames for i686 architecture 2023-03-14 22:47:32 +01:00
5677719038
Initialize thread context for AMD64 2023-03-14 17:37:20 +01:00
8f653c47dc
Initial Deferred Procedure Call (DPC) support 2023-03-05 22:56:16 +01:00
fd8eec1d86
Add EFLAGS and THREAD_ENVIRONMENT_BLOCK for amd64 2023-03-05 19:03:34 +01:00
70795ae57a
Add EFLAGS and THREAD_ENVIRONMENT_BLOCK for x86 2023-03-05 18:11:57 +01:00
c5a9253ea8
Implement ArLoadLocalDescriptorTable() routine 2023-03-02 23:04:36 +01:00
870a6680b0
Add thread information block 2023-03-01 00:14:06 +01:00
3d42fcc0f5
Add KSWITCH_FRAME definition for i686 architecture 2023-03-01 00:03:20 +01:00
e8e6cf1192
Set calling convention in each routine callback 2023-02-28 19:41:58 +01:00
ef23acc3bc
Add Deferred Procedure Call (DPC) and processor power state related structures 2023-02-27 19:58:47 +01:00
e41de62dab
Implement ArYieldProcessor() routine 2023-02-27 17:28:20 +01:00
9c74aafe3d
Initial implementation of process initialization 2023-02-24 19:52:20 +01:00
c4d1f1cd0d
Initial implementation of the thread initialization 2023-02-23 20:11:21 +01:00
9e264e5327
Update kernel related structures 2023-02-21 16:49:44 +01:00
c8428241dd
Add missing headers containing forward references of MM routines 2023-02-20 22:22:32 +01:00
3354075900
Initial Asynchronous Procedure Call (APC) support 2023-02-18 00:04:51 +01:00
3ba3a57881
Add missing KPRIORITY definition 2023-02-17 09:41:53 +01:00
08405e7bdc
Ad more routines for semaphores support 2023-02-17 09:40:18 +01:00
ccaa28399a
Initial semaphores support 2023-02-16 19:29:36 +01:00
98884516a1
Implement KeInitializeSpinLock() routine 2023-02-16 18:34:46 +01:00
b2456fd18a
Implement kernel timer initialization routines 2023-02-16 17:56:35 +01:00
91e4176e45
Include more headers to satisfy clang 2023-02-16 17:52:55 +01:00
4a737d0472
Remove kertptr header file 2023-02-16 17:48:59 +01:00
feff0d9b7b
More core kernel library structures 2023-02-16 17:46:51 +01:00
785c515e36
Add dispatcher object header definition 2023-02-15 22:49:59 +01:00
b1c2b209e3
Implement RtlGetStackLimits() routine 2023-02-15 20:12:58 +01:00
d28687631b
Add thread stack information to the structure 2023-02-15 20:08:19 +01:00
18a39f95bc
Add floating save area structure definitions 2023-02-15 20:07:17 +01:00
28b760b089
Add stubs for allocating and freeing kernel stacks 2023-02-14 22:35:16 +01:00
2e790bd9b2
Add pages related macros and definitions 2023-02-13 23:01:20 +01:00
050f24f877
Implement routines for atomically work with linked lists 2023-02-13 22:36:03 +01:00
9e5fb84412
More routines for performing atomic bitwise AND/OR/XOR operations 2023-02-12 23:11:23 +01:00
5a86d61b78
Implement routines for performing atomic operations 2023-02-12 22:46:58 +01:00
6411fc3ae9
Simplify single linked list header 2023-02-11 12:41:00 +01:00
4cae0447c1
Add single linked list definitions 2023-02-11 00:27:36 +01:00
e94cb2d3a7
Processor identification structures 2023-02-10 17:14:12 +01:00
e645cf664c
Set process and thread information in processor control block 2023-02-09 17:30:24 +01:00
e3a900088c
Initial process and thread related structures 2023-02-08 23:56:29 +01:00
9132c47cd9
Initial process and thread related structures 2023-02-08 23:40:58 +01:00
d8c68ed003
Add endian conversion routines 2023-02-08 16:33:57 +01:00
a32e18b237
Implement ArReadFSDualWord() routine 2023-02-07 23:19:22 +01:00
75c519a70c
Use more generic name for this macro use pointer used behind it will point to kernel debugger after it gets initialized 2023-02-07 19:37:44 +01:00
f8d2ccc0d0
Add more debugging macros 2023-02-06 16:10:32 +01:00
707c92e08a
Boot loader no longer needs to do anything related to the stack 2023-02-05 10:03:21 +01:00
c6cadbd655
Initialize MXCSR register 2023-02-05 00:30:12 +01:00
5eaf7d63a3
Initialize Page Attribute Table 2023-02-05 00:14:34 +01:00
55cdae7c83
Initialize AMD64 processor registers 2023-02-04 23:40:03 +01:00
f37722b6e6
Distinguish ProcessorBlock and ProcessorControlBlock 2023-02-03 19:28:03 +01:00
269214ed34
Another improvements to GDT 2023-02-03 18:00:37 +01:00
19f34d4b17
Cleanup the code 2023-02-02 19:42:57 +01:00
715f875c4f
Set alignment and packing properly 2023-02-02 17:01:18 +01:00
2e2b01742a
Definitions for setting structures alignment and packing 2023-02-02 15:47:21 +01:00
73fc7607cd
There is no need to specify alignment of the structure in the forward reference 2023-02-02 15:37:57 +01:00
dc1a94b982
This is 'Processor Block' 2023-02-01 22:02:07 +01:00
21fbe6febe
Add IDT related definitions 2023-02-01 20:14:10 +01:00
5bbda188c6
IDT access levels and gate types 2023-02-01 00:51:13 +01:00
9a1e9b1084
Define TSS offsets 2023-01-30 23:43:10 +01:00
a761d3125a
Architecture specific initialization prior to processor structures initialization 2023-01-30 20:34:05 +01:00
6f068513cd
Initial processor block initialization 2023-01-30 19:07:05 +01:00
ebe6792f2b
Add MSR (Model Specific Registers) values 2023-01-30 17:59:00 +01:00
ce4e590347
Add missing forward declaration of ArInitializeProcessor() routine 2023-01-29 00:57:06 +01:00
900e71459a
Add missing x86 descriptor sizes 2023-01-29 00:54:36 +01:00
7bf4a9ab8d
Initialize boot CPU structures inside kernel on AMD64 2023-01-29 00:45:17 +01:00
27e2fdf4f2
Introduce architecture library as new kernel subsystem and move selected routines into new subsystem 2023-01-28 10:34:55 +01:00
e94e50b5d9
Implement HlLoadInterruptDescriptorTable() intrinsics for loading IDT 2023-01-26 20:08:57 +01:00
3ad3149f80
Add descriptor structure definition 2023-01-25 17:42:35 +01:00
bfc9db8b6d
Unify KGDTENTRY and KIDTENTRY between architectures as much as possible 2023-01-25 17:35:03 +01:00
3ee759cc27
i686 Interrupt request levels definitions 2023-01-25 17:18:27 +01:00
7bd67d6210
Add GDT and Segments related definitions for i686 2023-01-25 17:13:24 +01:00
a366de618f
AMD64 Interrupt request levels definitions 2023-01-25 17:08:42 +01:00
8f348c3954
Add GDT and Segments related definitions for AMD64 2023-01-25 17:05:15 +01:00
707dc37868
Fix type of Source parameter in HlLoadSegment() routine 2023-01-24 23:08:48 +01:00
35aa514f95
Implement HlLoadSegment() intrinsics routine 2023-01-24 19:27:18 +01:00
d3d8d144a0
Implement HlLoadGlobalDescriptorTable() intrinsic 2023-01-23 20:13:51 +01:00
c81b858757
Implement HlReadGSQuadWord() intrinsic 2023-01-23 19:59:54 +01:00
f20ab3e52e
Implement HlLoadTaskRegister() for loading TSS segment selector into task register 2023-01-23 15:26:35 +01:00
9cbe2d458c
Initial support for EFI framebuffer 2023-01-23 15:26:35 +01:00
145fc17271
Pass framebuffer pitch information to the kernel 2023-01-18 20:15:41 +01:00
41a0a2b37c
Shorter and longer version of the build timestamp 2023-01-18 20:10:03 +01:00
1a93c198ed
Add missing forward reference to _LOADER_GRAPHICS_INFORMATION_BLOCK structure 2023-01-16 19:51:19 +01:00
605597262c
Initial version of EFI framebuffer module, currently support only GOP 2023-01-16 18:41:25 +01:00
e3f0782053
Add enumeration of efi supported graphics protocols 2023-01-16 00:10:44 +01:00
5d74fb2bb5
Add UGA related structures 2023-01-16 00:03:35 +01:00
fb60625abc
Add more intrinsic routines 2023-01-13 22:32:45 +01:00
21abe0553a
Code formatting 2023-01-11 15:39:36 +01:00
beed5e0b51
More architecture specific definitions 2023-01-11 15:29:43 +01:00
025e05013d
Partially revert last changes 2023-01-10 22:51:38 +01:00
bac7af8a33
Cleanup data types 2023-01-09 23:07:21 +01:00
6255165f10
Add missing EFI enumeration lists forward references 2023-01-08 09:31:40 +01:00
fd6e273d8a
Add missing forward references 2023-01-07 23:44:00 +01:00
ca1d7ddfe8
Basic context, frames and exceptions definitions 2023-01-07 23:36:50 +01:00
f74ba62f24
Add GDT, IDT and TSS related structures 2023-01-07 13:33:16 +01:00
3f54c9b37e
Allow to set XT subsystem when producing binaries 2023-01-06 16:18:04 +01:00
b22a76e3c4
Add XT native kernel subsystem to the PE/COFF image support 2023-01-06 16:16:26 +01:00
674e69da0e
Cleanup useless externals 2023-01-05 23:38:58 +01:00
712de4e4e4
XTDK contains headers uniquely identified 2023-01-05 23:28:43 +01:00
3250ad67aa
Rename header file 2023-01-05 23:09:54 +01:00
3131aac7a9
Move serial ports I/O address to architecture specific header 2023-01-05 15:58:36 +01:00
5730e8692e
Reorganisation of KeStartXtSystem() routine and early debug printing 2023-01-04 23:08:59 +01:00
b7e5f1b5c1
Use CR constants instead of hardcoded values 2023-01-04 16:33:28 +01:00
a5b3350559
Add _M128 structure definition 2023-01-04 16:16:17 +01:00
b22303003c
Add architecture name 2023-01-03 16:28:14 +01:00
d8f2135ac6
Add more PCI(E) related definitions 2023-01-02 23:59:32 +01:00
c5a7d0fe05
Improvements in COM port support 2023-01-02 16:14:00 +01:00
e8e7d7b905
Add missing forward declaration 2023-01-02 16:11:50 +01:00
4c031f4075
Add I/O related type definitions 2023-01-02 16:10:43 +01:00
94e9fa1293
Allow to provide custom COM port address 2022-12-29 23:44:52 +01:00
feabac2d98
Set XTOS NT compatibility version 2022-12-29 22:39:39 +01:00
58527ce5cb
Set correct image version 2022-12-29 22:37:39 +01:00
e6a7918bac
Fix release build 2022-12-28 23:28:49 +01:00
dec021b1ec
Reorganize early debug printing; initialize kernel stacks when needed 2022-12-28 23:11:35 +01:00
9dc0e60f28
We support EFI-enabled systems only and such machines should support PAE, so there is no need for XTLDR to support non-PAE x86 hardware 2022-12-28 15:57:03 +01:00
fcfa575bff
Implement HlReadTimeStampCounter() routine 2022-12-27 23:28:27 +01:00
f46615f92c
Implement HlInvalidateTlbEntry(), HlReadModelSpecificRegister() and HlWriteModelSpecificRegister() routines 2022-12-27 23:19:33 +01:00
602d89ef27
Fixes in HlIoPortInShort() and HlIoPortInLong() routines 2022-12-27 22:43:19 +01:00
9828b23400
Implement HlIoPortInShort(), HlIoPortInLong(), HlIoPortOutShort() and HlIoPortOutLong() routines 2022-12-27 22:26:45 +01:00
bffb93b58c
Add missing calling convention 2022-12-27 22:05:46 +01:00
5b75d005a7
Implement HlClearInterruptFlag() and HlSetInterruptFlag() intrinsic routines 2022-12-27 18:54:01 +01:00
8f3a4aef60
Code formatting 2022-12-23 22:27:08 +01:00
93ad0b4ea0
Set valid calling convention for HAL routines 2022-12-23 14:41:11 +01:00
3ab1695968
Common routines for reading from and writing to CPU control registers 2022-12-23 14:30:52 +01:00
3e8bdfe9fe
Add missing forward routines definitions 2022-12-23 00:09:33 +01:00
e9d30a0fd9
Add missing forward structures definitions 2022-12-22 22:58:52 +01:00
6c4496f839
KERNEL_STACK_SIZE should be expressed in bytes as the name suggests, calculate number of pages where needed 2022-12-21 22:24:16 +01:00
652e3293b1
Get rid of EfiImageHandle and EfiSystemTable in UEFI_FIRMWARE_INFORMATION 2022-12-20 23:08:28 +01:00
7c38efc802
Update boot sequence and check PE/COFF image machine type compatibility 2022-12-20 19:11:15 +01:00
acda7aa37c
Add EFI_MEMORY_MAP structure definition 2022-12-20 15:52:15 +01:00
eb5998c58e
Add a way to check PE/COFF image machine type 2022-12-20 15:37:13 +01:00