From 6125ac9b8c864eeeb4619021cdde0f40e784fc14 Mon Sep 17 00:00:00 2001 From: Miguel Date: Fri, 21 Sep 2018 11:08:21 +0200 Subject: cleaning at userspace --- kernel/kernel.c | 2 +- kernel/kernel.h | 1 + userspace/Makefile | 8 ++--- userspace/file.txt | 82 ------------------------------------------------- userspace/files/col.txt | 7 +++++ userspace/grep.c | 9 +++--- userspace/test.txt | 7 ----- 7 files changed, 16 insertions(+), 100 deletions(-) delete mode 100644 userspace/file.txt create mode 100644 userspace/files/col.txt delete mode 100644 userspace/test.txt diff --git a/kernel/kernel.c b/kernel/kernel.c index 2e2e3e6..247e978 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -115,7 +115,7 @@ void kernel_main(uint32_t eax,uint32_t ebx) // binfont has to fit in ONE ext2 block // fixme("support binfonts spanning multiple blocks?"); - uint32_t inode= ext2_filename_to_inode(VMEM_EXT2_RAMIMAGE,"/binfont.bin"); + uint32_t inode= ext2_filename_to_inode(VMEM_EXT2_RAMIMAGE,VESA_FONT_PATH); uint32_t addr= ext2_inode_blockstart( VMEM_EXT2_RAMIMAGE,inode,0); vesa_init(cfg_multiboot->vbe_control_info,cfg_multiboot->vbe_mode_info,addr); diff --git a/kernel/kernel.h b/kernel/kernel.h index e52bcf3..9e67c34 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -30,6 +30,7 @@ REFERENCES #define MAX_MOUNTS 10 #define BIN_INIT "/bin/init" +#define VESA_FONT_PATH "/doc/fonts/binfont.bin" #define FIFO_MAX_RINGBUFFERS 20 #define MAX_FIFOS 20 diff --git a/userspace/Makefile b/userspace/Makefile index f2ca823..f69ea9d 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -41,16 +41,12 @@ ext2.img: $(PROGS) @sudo chown miguel mnt @mkdir -p mnt/home/miguel @mkdir -p mnt/boot - @echo "Welcome to FoolOs\nWe hope you will enjoy your stay." > mnt/home/miguel/hello.txt - @cp file.txt mnt/home/miguel/file.txt @mkdir -p mnt/bin - @mkdir -p mnt/doc/test + @mkdir -p mnt/doc/fonts @mkdir -p mnt/sys # mountpoint for sysfs @mkdir -p mnt/pipes # mountpoint for pipes - @cp test.txt mnt/doc/test/ @cp $(PROGS) mnt/bin - @cp fonts/binfont.bin mnt/ - @echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++." > mnt/home/miguel/hello.brain + @cp fonts/binfont.bin mnt/doc/fonts # cp ~/temp/fool-os-stuff/binutils-build-host-foolos/binutils/readelf mnt/bin # cp ../font/binfont.bin mnt/ diff --git a/userspace/file.txt b/userspace/file.txt deleted file mode 100644 index 8cdd524..0000000 --- a/userspace/file.txt +++ /dev/null @@ -1,82 +0,0 @@ -Sometimes someone would speak in a boat. But most -of the boats were silent except for the dip of the -oars. They spread apart after they were out of the -mouth of the harbour and each one headed for the -part of the ocean where he hoped to find fish. The -old man knew he was going far out and he left the -smell of the land behind and rowed out into the -clean early morning smell of the ocean. He saw the -phosphorescence of the Gulf weed in the water as -he rowed over the part of the ocean that the -fishermen called the great well because there was -a sudden deep of seven hundred fathoms where all -sorts of fish congregated because of the swirl the -current made against the steep walls of the floor -of the ocean. Here there were concentrations of -shrimp and bait fish and sometimes schools of -squid in the deepest holes and these rose close to -the surface at night where all the wandering fish -fed on them. - -In the dark the old man could feel the morning -coming and as he rowed he heard the trembling -sound as flying fish left the water and the -hissing that their stiff set wings made as they -soared away in the darkness. He was very fond of -flying fish as they were his principal friends on -the ocean. He was sorry for the birds, especially -the small delicate dark terns that were always -flying and looking and almost never finding, and -he thought, "The birds have a harder life than we -do except for the robber birds and the heavy -strong ones. Why did they make birds so delicate -and fine as those sea swallows when the ocean can -be so cruel? She is kind and very beautiful. But -she can be so cruel and it comes so suddenly and -such birds that fly, dipping and hunting, with -their small sad voices are made too delicately for -the sea." - -He always thought of the sea as la mar which is -what people call her in Spanish when they love -her. Sometimes those who love her say bad things -of her but they are always said as though she were -a woman. Some of the younger fishermen, those who -used buoys as floats for their lines and had -motorboats, bought when the shark livers had -brought much money, spoke of her as el mar which -is masculine. They spoke of her as a contestant or -a place or even an enemy. But the old man always -thought of her as feminine and as something that -gave or withheld great favours, and if she did -wild or wicked things it was because she could not -help them. The moon affects her as it does a -woman, he thought. - -He was rowing steadily and it was no effort for -him since he kept well within his speed and the -surface of the ocean was flat except for the -occasional swirls of the current. He was letting -the current do a third of the work and as it -started to be light he saw he was already further -out than he had hoped to be at this hour. - -I worked the deep wells for a week and did -nothing, he thought. Today I'll work out where the -schools of bonita and albacore are and maybe there -will be a big one with them. - -Before it was really light he had his baits out -and was drifting with the current. One bait was -down forty fathoms. The second was at seventy-five -and the third and fourth were down in the blue -water at one hundred and one hundred and -twenty-five fathoms. Each bait hung head down with -the shank of the hook inside the bait fish, tied -and sewed solid and all the projecting part of the -hook, the curve and the point, was covered with -fresh sardines. Each sardine was hooked through -both eyes so that they made a half-garland on the -projecting steel. There was no part of the hook -that a great fish could feel which was not sweet -smelling and good tasting. diff --git a/userspace/files/col.txt b/userspace/files/col.txt new file mode 100644 index 0000000..7a22897 --- /dev/null +++ b/userspace/files/col.txt @@ -0,0 +1,7 @@ +HELLO THIS IS A TEXTFILE +USED FOR TESTING THE FOOL OS EXT2 RAM IMAGE +TRY TO READ ME! + +  [COLOR CODES ARE SUPPORTED TOO FROM FILES]  + +BYE diff --git a/userspace/grep.c b/userspace/grep.c index 058f1f8..d3ca687 100644 --- a/userspace/grep.c +++ b/userspace/grep.c @@ -49,11 +49,12 @@ int main(int argc, char **argv) FILE *out=stdout; int i=1; - while(!feof(in)) + + char buf[256]; + char buf2[255]; + + while(NULL!=fgets(buf,255,in)) { - char buf[256]; - char buf2[255]; - fgets(buf,255,in); char *pos=strstr(buf,argv[1]); if(pos) diff --git a/userspace/test.txt b/userspace/test.txt deleted file mode 100644 index 7a22897..0000000 --- a/userspace/test.txt +++ /dev/null @@ -1,7 +0,0 @@ -HELLO THIS IS A TEXTFILE -USED FOR TESTING THE FOOL OS EXT2 RAM IMAGE -TRY TO READ ME! - -  [COLOR CODES ARE SUPPORTED TOO FROM FILES]  - -BYE -- cgit v1.2.3