Skip to content

Commit 27899a5

Browse files
committed
x86_pc: Start unavailable memory in legacy after memory end
1 parent 79613cd commit 27899a5

4 files changed

Lines changed: 6 additions & 16 deletions

File tree

src/platform/x86_pc/os.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void OS::legacy_boot()
202202

203203
uintptr_t high_memory_size = mem.extended.total * 1024;
204204
INFO2("* High memory (from cmos): %i Kib", mem.extended.total);
205-
OS::memory_end_ = 0x100000 + high_memory_size;
205+
OS::memory_end_ = 0x100000 + high_memory_size - 1;
206206
}
207207

208208
auto& memmap = memory_map();
@@ -216,7 +216,7 @@ void OS::legacy_boot()
216216
uintptr_t addr_max = std::numeric_limits<std::size_t>::max();
217217
uintptr_t span_max = std::numeric_limits<std::ptrdiff_t>::max();
218218

219-
uintptr_t unavail_start = OS::memory_end_;
219+
uintptr_t unavail_start = OS::memory_end_+1;
220220
size_t interval = std::min(span_max, addr_max - unavail_start) - 1;
221221
uintptr_t unavail_end = unavail_start + interval;
222222

src/platform/x86_pc/softreset.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ void OS::resume_softreset(intptr_t addr)
4545
data->checksum = csum_copy;
4646

4747
/// restore known values
48-
OS::liveupdate_loc_ = data->liveupdate_loc;
49-
OS::memory_end_ = data->high_mem;
50-
OS::cpu_mhz_ = data->cpu_freq;
48+
OS::liveupdate_loc_ = data->liveupdate_loc;
49+
OS::memory_end_ = data->high_mem;
50+
OS::cpu_mhz_ = data->cpu_freq;
5151
x86::apic_timer_set_ticks(data->apic_ticks);
5252

5353
/// call service-specific softreset handler

test/kernel/integration/LiveUpdate/config.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/kernel/integration/LiveUpdate/service.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ void Service::start()
3030
if (liu::LiveUpdate::is_resumable() == false)
3131
{
3232
auto& inet = net::Super_stack::get<net::IP4>(0);
33+
inet.network_config({10,0,0,49}, {255,255,255,0}, {10,0,0,1});
3334
setup_liveupdate_server(inet, 666, func);
3435
// signal test.py that the server is up
3536
printf("Ready to receive binary blob\n");

0 commit comments

Comments
 (0)