Skip to content

Commit ed77890

Browse files
committed
* Updated Makefile
* Updated makefile.yml * Fixed a bug in ata driver
1 parent 3bc3aaf commit ed77890

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

.github/workflows/makefile.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ jobs:
2828
- name: Compile kernel
2929
run: make kernel
3030

31-
- name: Create ISO
32-
run: make iso
33-
34-
- name: Create hdfile
35-
run: make sorhd
36-
37-
# - name: Upload compiled toolchain
38-
# uses: actions/upload-artifact@v2
39-
# with:
40-
# name: sectoros_toolchain
41-
# path: ~/toolchain.tar.xz
42-
4331
- name: Upload kernel
4432
uses: actions/upload-artifact@v2
4533
with:
4634
name: kernel
4735
path: SectorOS-RW4.elf
4836

37+
- name: Create ISO
38+
run: make iso
39+
4940
- name: Upload ISO
5041
uses: actions/upload-artifact@v2
5142
with:
5243
name: iso
5344
path: SectorOS-RW4.iso
45+
46+
- name: Create hdfile
47+
run: make sorhd
48+
49+
# - name: Upload compiled toolchain
50+
# uses: actions/upload-artifact@v2
51+
# with:
52+
# name: sectoros_toolchain
53+
# path: ~/toolchain.tar.xz
5454

5555
- name: Upload HDIMAGE
5656
uses: actions/upload-artifact@v2

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ stopTAP1:
259259
modules: $(MODULES)
260260

261261
$(FILESDIR)/%.ko : $(SRCDIR)/modules/%.c
262-
$(CC) -c -g -pedantic -ffreestanding -static -I$(INCLUDEDIR) -o $@ $<
262+
$(PREFIX)/$(CC) -c -g -pedantic -ffreestanding -static -I$(INCLUDEDIR) -o $@ $<
263263

264264
moduleclean:
265265
rm $(MODULES)

src/common/libs/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ void stoc(size_t n, char* buf)
367367

368368
char* stoc_r(size_t n)
369369
{
370-
char* buffer = (char*)kmalloc(1024);
370+
char* buffer = (char*)kmalloc(32);
371371

372372
stoc(n, buffer);
373373
return buffer;

src/drivers/storage/atapio.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "atapio.h"
22
#include "mbr.h"
3+
#include "logdisk.h"
34

45
ata_pio_t ap0m;
56
ata_pio_t ap0s;
@@ -81,10 +82,13 @@ void ata_pio_identify(ata_pio_t* ap)
8182
uint16_t * id = (uint16_t*)kmalloc(256);
8283
memset(id, 0, 256);
8384
uint8_t * id_buf = (uint8_t*)id;
85+
//serialprintf("-------START ATA %d IDENTIFY--------\n", (ap->basePort == 0x1F0) ? (ap->master ? 0 : 1) : (ap->master ? 2 : 3));
8486
for(int i = 0; i < 256; i++)
8587
{
8688
id[i] = inw(ap->dataPort);
89+
//serialprintf("%02x ", id_buf[i]);
8790
}
91+
//serialprintf("\n-------END ATA %d IDENTIFY--------\n", (ap->basePort == 0x1F0) ? (ap->master ? 0 : 1) : (ap->master ? 2 : 3));
8892
printf("[ATA PIO] Device found\n");
8993

9094
ap->channel = 1;
@@ -114,13 +118,10 @@ void ata_pio_identify(ata_pio_t* ap)
114118

115119
ap->model[40] = 0;
116120

117-
printf("[ATA PIO] Model: %s\n", ap->model);
118-
printf("[ATA PIO] Size: %s\n", stoc_r(ap->size));
119-
120-
printf("[ATA PIO] Device found on %s %s\n", ap->basePort == 0x1F0 ? "Primary" : "Secondary", ap->master ? "Master" : "Slave");
121-
printf("[ATA PIO] Model: %s\n", ap->model);
122-
printf("[ATA PIO] Size: %dB\n", ap->size);
123-
printf("[ATA PIO] Signature: 0x%x\n", ap->signature);
121+
ldprintf("ATA PIO", LOG_INFO, "Device found on %s %s", ap->basePort == 0x1F0 ? "Primary" : "Secondary", ap->master ? "Master" : "Slave");
122+
ldprintf("ATA PIO", LOG_INFO, "Model: %s", ap->model);
123+
ldprintf("ATA PIO", LOG_INFO, "Size: %s", stoc_r(ap->size*512));
124+
ldprintf("ATA PIO", LOG_INFO, "Signature: 0x%x", ap->signature);
124125

125126
FILE* f = ata_pio_GetVFSNode(ap);
126127

0 commit comments

Comments
 (0)