Compare commits

...

36 Commits

Author SHA1 Message Date
mintsuki
751e802e17 Binary release v3.20221230.0 2022-12-30 08:16:02 +00:00
mintsuki
b081e70e19 Binary release v3.20221216.0 2022-12-16 03:00:16 +00:00
mintsuki
9b748f508d Binary release v3.20221214.0 2022-12-14 00:09:55 +00:00
mintsuki
3cfdc8a88d Binary release v3.20221204.0 2022-12-04 09:46:34 +00:00
mintsuki
2b12406a79 Binary release v3.20221119.0 2022-11-19 07:15:03 +00:00
mintsuki
997f6ccaa6 Binary release v3.20221114.1 2022-11-14 07:07:27 +00:00
mintsuki
889a82106c Binary release v3.20221114.0 2022-11-14 07:00:05 +00:00
mintsuki
bab8bea067 Binary release v3.20221112.0 2022-11-11 23:42:09 +00:00
mintsuki
9a11151f0c Binary release v3.20221102.0 2022-11-02 14:29:42 +00:00
mintsuki
b5dbed953c Binary release v3.20221030.0 2022-10-30 13:59:18 +00:00
mintsuki
8a28109a17 Binary release v3.20221017.0 2022-10-17 04:39:35 +00:00
mintsuki
7a0c0a7fb3 Binary release v3.20221016.0 2022-10-15 23:27:18 +00:00
mintsuki
bc5dbcae08 Binary release v3.20221014.1 2022-10-14 12:29:54 +00:00
mintsuki
71e05dc165 Binary release v3.20221014.0 2022-10-14 05:49:54 +00:00
mintsuki
97f617767c Binary release v3.20221011.0 2022-10-11 03:57:41 +00:00
mintsuki
13e9ba0ebc Binary release v3.20221009.0 2022-10-09 09:07:51 +00:00
mintsuki
e42e1c0d1b Binary release v3.20221007.0 2022-10-07 08:11:17 +00:00
mintsuki
101c1490f7 Binary release v3.20221006.0 2022-10-06 17:15:56 +00:00
mintsuki
95e78137b0 Binary release v3.20220928.0 2022-09-28 00:07:43 +00:00
mintsuki
ec558edef4 Binary release v3.20220927.0 2022-09-27 04:53:26 +00:00
mintsuki
d96dc79a42 Binary release v3.25 2022-09-24 02:32:11 +00:00
mintsuki
27816688cf Binary release v3.24 2022-09-22 16:14:49 +00:00
mintsuki
c5ceb70e60 Binary release v3.23 2022-09-22 15:07:42 +00:00
mintsuki
032c49db72 Binary release v3.22.3 2022-09-20 21:55:28 +00:00
mintsuki
5c8f3f2f99 Binary release v3.22.2 2022-09-20 08:35:37 +00:00
mintsuki
6bfc97dd87 Binary release v3.22.1 2022-09-18 22:01:53 +00:00
mintsuki
111ae25c86 Binary release v3.22 2022-09-16 09:36:48 +00:00
mintsuki
e98107b7db Binary release v3.21.1 2022-09-15 01:11:34 +00:00
mintsuki
0d3698d6d8 Binary release v3.21 2022-09-05 01:39:31 +00:00
mintsuki
35132937f8 Binary release v3.20.1 2022-09-03 08:59:58 +00:00
mintsuki
510a4389d5 Binary release v3.20 2022-09-02 02:19:43 +00:00
mintsuki
bc318c8d5e Binary release v3.19 2022-09-01 03:13:36 +00:00
mintsuki
d6d0e88689 Binary release v3.18.3 2022-08-30 06:08:36 +00:00
mintsuki
daaf492656 Binary release v3.18.2 2022-08-29 10:13:56 +00:00
mintsuki
fac3a4bc54 Binary release v3.18.1 2022-08-28 22:33:13 +00:00
mintsuki
34f4e9c222 Binary release v3.18 2022-08-27 11:41:12 +00:00
12 changed files with 1642 additions and 1576 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -38,8 +38,8 @@ clean:
rm -f limine-deploy limine-deploy.exe
rm -f limine-version limine-version.exe
limine-deploy: limine-deploy.c
$(CC) $(CFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-deploy.c -o $@
limine-deploy: limine-deploy.c limine-hdd.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-deploy.c $(LIBS) -o $@
limine-version: limine-version.c
$(CC) $(CFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-version.c -o $@
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -std=c99 -D__USE_MINGW_ANSI_STDIO limine-version.c $(LIBS) -o $@

Binary file not shown.

Binary file not shown.

View File

@@ -14,6 +14,8 @@
#include "limine-hdd.h"
static bool quiet = false;
static int set_pos(FILE *stream, uint64_t pos) {
if (sizeof(long) >= 8) {
return fseek(stream, (long)pos, SEEK_SET);
@@ -202,7 +204,9 @@ static bool device_init(void) {
block_size = guesses[i];
fprintf(stderr, "Physical block size of %zu bytes.\n", block_size);
if (!quiet) {
fprintf(stderr, "Physical block size of %zu bytes.\n", block_size);
}
cache_state = CACHE_CLEAN;
cached_block = 0;
@@ -286,7 +290,9 @@ static void free_undeploy_data(void) {
}
static bool store_undeploy_data(const char *filename) {
fprintf(stderr, "Storing undeploy data to file: `%s`...\n", filename);
if (!quiet) {
fprintf(stderr, "Storing undeploy data to file: `%s`...\n", filename);
}
FILE *udfile = fopen(filename, "wb");
if (udfile == NULL) {
@@ -321,7 +327,9 @@ error:
}
static bool load_undeploy_data(const char *filename) {
fprintf(stderr, "Loading undeploy data from file: `%s`...\n", filename);
if (!quiet) {
fprintf(stderr, "Loading undeploy data from file: `%s`...\n", filename);
}
FILE *udfile = fopen(filename, "rb");
if (udfile == NULL) {
@@ -449,7 +457,9 @@ static void undeploy(void) {
fprintf(stderr, "ERROR: Undeploy data index %zu failed to write. Undeploy may be incomplete!\n", i);
break;
}
fprintf(stderr, "Warning: Undeploy data index %zu failed to write, retrying...\n", i);
if (!quiet) {
fprintf(stderr, "Warning: Undeploy data index %zu failed to write, retrying...\n", i);
}
if (!device_flush_cache()) {
fprintf(stderr, "ERROR: Device cache flush failure. Undeploy may be incomplete!\n");
}
@@ -463,7 +473,9 @@ static void undeploy(void) {
fprintf(stderr, "ERROR: Device cache flush failure. Undeploy may be incomplete!\n");
}
fprintf(stderr, "Undeploy data restored successfully. Limine undeployed!\n");
if (!quiet) {
fprintf(stderr, "Undeploy data restored successfully. Limine undeployed!\n");
}
}
#define device_read(BUFFER, LOC, COUNT) \
@@ -490,6 +502,8 @@ static void usage(const char *name) {
printf(" Set the input (for --undeploy) or output file\n");
printf(" name of the file which contains undeploy data\n");
printf("\n");
printf(" --quiet Do not print verbose diagnostic messages\n");
printf("\n");
printf(" --help | -h Display this help message\n");
printf("\n");
#ifdef IS_WINDOWS
@@ -519,18 +533,20 @@ int main(int argc, char *argv[]) {
if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
usage(argv[0]);
return EXIT_SUCCESS;
} else if (strcmp(argv[i], "--quiet") == 0) {
quiet = true;
} else if (strcmp(argv[i], "--force-mbr") == 0) {
if (force_mbr) {
if (force_mbr && !quiet) {
fprintf(stderr, "Warning: --force-mbr already set.\n");
}
force_mbr = 1;
} else if (strcmp(argv[i], "--undeploy") == 0) {
if (undeploy_mode) {
if (undeploy_mode && !quiet) {
fprintf(stderr, "Warning: --undeploy already set.\n");
}
undeploy_mode = true;
} else if (memcmp(argv[i], "--undeploy-data-file=", 21) == 0) {
if (undeploy_file != NULL) {
if (undeploy_file != NULL && !quiet) {
fprintf(stderr, "Warning: --undeploy-data-file already set. Overriding...\n");
}
undeploy_file = argv[i] + 21;
@@ -554,8 +570,9 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
if (!device_init())
goto cleanup;
if (!device_init()) {
goto undeploy_mode_cleanup;
}
if (undeploy_mode) {
if (undeploy_file == NULL) {
@@ -584,10 +601,12 @@ int main(int argc, char *argv[]) {
lb_size = lb_guesses[i];
if (!force_mbr) {
gpt = 1;
fprintf(stderr, "Deploying to GPT. Logical block size of %" PRIu64 " bytes.\n",
lb_guesses[i]);
if (!quiet) {
fprintf(stderr, "Deploying to GPT. Logical block size of %" PRIu64 " bytes.\n",
lb_guesses[i]);
}
} else {
fprintf(stderr, "Device has a valid GPT, refusing to force MBR.\n");
fprintf(stderr, "ERROR: Device has a valid GPT, refusing to force MBR.\n");
goto cleanup;
}
break;
@@ -596,14 +615,18 @@ int main(int argc, char *argv[]) {
struct gpt_table_header secondary_gpt_header;
if (gpt) {
fprintf(stderr, "Secondary header at LBA 0x%" PRIx64 ".\n",
ENDSWAP(gpt_header.alternate_lba));
if (!quiet) {
fprintf(stderr, "Secondary header at LBA 0x%" PRIx64 ".\n",
ENDSWAP(gpt_header.alternate_lba));
}
device_read(&secondary_gpt_header, lb_size * ENDSWAP(gpt_header.alternate_lba),
sizeof(struct gpt_table_header));
if (!strncmp(secondary_gpt_header.signature, "EFI PART", 8)) {
fprintf(stderr, "Secondary header valid.\n");
if (!quiet) {
fprintf(stderr, "Secondary header valid.\n");
}
} else {
fprintf(stderr, "Secondary header not valid, aborting.\n");
fprintf(stderr, "ERROR: Secondary header not valid, aborting.\n");
goto cleanup;
}
}
@@ -718,8 +741,10 @@ int main(int argc, char *argv[]) {
}
if (mbr && !any_active) {
fprintf(stderr, "No active partition found, some systems may not boot.\n");
fprintf(stderr, "Setting partition 1 as active to work around the issue...\n");
if (!quiet) {
fprintf(stderr, "No active partition found, some systems may not boot.\n");
fprintf(stderr, "Setting partition 1 as active to work around the issue...\n");
}
hint8 = 0x80;
device_write(&hint8, 446, sizeof(uint8_t));
}
@@ -766,14 +791,18 @@ int main(int argc, char *argv[]) {
goto cleanup;
}
fprintf(stderr, "GPT partition specified. Deploying there instead of embedding.\n");
if (!quiet) {
fprintf(stderr, "GPT partition specified. Deploying there instead of embedding.\n");
}
stage2_loc_a = ENDSWAP(gpt_entry.starting_lba) * lb_size;
stage2_loc_b = stage2_loc_a + stage2_size_a;
if (stage2_loc_b & (lb_size - 1))
stage2_loc_b = (stage2_loc_b + lb_size) & ~(lb_size - 1);
} else {
fprintf(stderr, "GPT partition NOT specified. Attempting GPT embedding.\n");
if (!quiet) {
fprintf(stderr, "GPT partition NOT specified. Attempting GPT embedding.\n");
}
int64_t max_partition_entry_used = -1;
for (int64_t i = 0; i < (int64_t)ENDSWAP(gpt_header.number_of_partition_entries); i++) {
@@ -809,7 +838,9 @@ int main(int argc, char *argv[]) {
goto cleanup;
}
fprintf(stderr, "New maximum count of partition entries: %zu.\n", new_partition_entry_count);
if (!quiet) {
fprintf(stderr, "New maximum count of partition entries: %zu.\n", new_partition_entry_count);
}
// Zero out unused partitions
void *empty = calloc(1, ENDSWAP(gpt_header.size_of_partition_entry));
@@ -862,11 +893,15 @@ int main(int argc, char *argv[]) {
sizeof(struct gpt_table_header));
}
} else {
fprintf(stderr, "Deploying to MBR.\n");
if (!quiet) {
fprintf(stderr, "Deploying to MBR.\n");
}
}
fprintf(stderr, "Stage 2 to be located at 0x%" PRIx64 " and 0x%" PRIx64 ".\n",
stage2_loc_a, stage2_loc_b);
if (!quiet) {
fprintf(stderr, "Stage 2 to be located at 0x%" PRIx64 " and 0x%" PRIx64 ".\n",
stage2_loc_a, stage2_loc_b);
}
// Save original timestamp
device_read(timestamp, 218, 6);
@@ -901,11 +936,13 @@ int main(int argc, char *argv[]) {
if (!device_flush_cache())
goto cleanup;
fprintf(stderr, "Reminder: Remember to copy the limine.sys file in either\n"
" the root or /boot directories of one of the partitions\n"
" on the device, or boot will fail!\n");
if (!quiet) {
fprintf(stderr, "Reminder: Remember to copy the limine.sys file in either\n"
" the root, /boot, /limine, or /boot/limine directories of\n"
" one of the partitions on the device, or boot will fail!\n");
fprintf(stderr, "Limine deployed successfully!\n");
fprintf(stderr, "Limine deployed successfully!\n");
}
ok = EXIT_SUCCESS;

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1,6 +1,6 @@
#include <stdio.h>
#define LIMINE_VERSION "3.17.3"
#define LIMINE_VERSION "3.20221230.0"
int main(void) {
puts(LIMINE_VERSION);

View File

@@ -1,3 +1,19 @@
/* BSD Zero Clause License */
/* Copyright (C) 2022 mintsuki and contributors.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _LIMINE_H
#define _LIMINE_H 1
@@ -97,6 +113,20 @@ struct limine_hhdm_request {
#define LIMINE_FRAMEBUFFER_RGB 1
struct limine_video_mode {
uint64_t pitch;
uint64_t width;
uint64_t height;
uint16_t bpp;
uint8_t memory_model;
uint8_t red_mask_size;
uint8_t red_mask_shift;
uint8_t green_mask_size;
uint8_t green_mask_shift;
uint8_t blue_mask_size;
uint8_t blue_mask_shift;
};
struct limine_framebuffer {
LIMINE_PTR(void *) address;
uint64_t width;
@@ -113,6 +143,9 @@ struct limine_framebuffer {
uint8_t unused[7];
uint64_t edid_size;
LIMINE_PTR(void *) edid;
/* Revision 1 */
uint64_t mode_count;
LIMINE_PTR(struct limine_video_mode **) modes;
};
struct limine_framebuffer_response {

Binary file not shown.